Glindra
Documentation Index Download
Command Line File Handling and ASCII Tools

Help and Information Options

These options display help text and set the level of information and error messages.

Example (Linux)
> copy '***/*.log' '/old/logs/*.*' -nowarning
Options
-help   -h   -?
Print out a brief help text with a summary of each of the different options, and exit from the program.
-version Show the name and version number of the program, and exit. This option must be written out in full, and cannot be abbreviated.
-verbose   -v
-statistics
-noverbose
Specify the amount of informational messages.
-warning
-nowarning
-noerror
Specify the level of error reporting.

-help   -h   -?

The -help option prints out a brief help text about the options that are available in the program. The output is written to stderr.

After writing out the required information, the program exits immediately, without doing anything else.

The -help option can be abbreviated down to -h, or written as -?.

As always, the option prefix can be either a single dash, two dashes, or, on Windows, a slash. If the option prefix is one or two dashes there has to be a whitespace before the prefix. This is not necessary if the option prefix is a slash on Windows.

When a command line contains the -help option (spelled in whichever way), this blocks the normal execution of the program. If the command line contained other options and/or parameters in addition to the -help option, these are simply ignored. If you use the -? form of the option, the command line does not even have to be syntactically correct. Before it looks at the rest of the command line, the parser will check if there is a -? option somewhere. If there is, it will cease to be interested in the command line, and just write out the help texts.

This is very useful if you find that you have forgotten the name of some option when you're half way into typing a long and complicated command. If you just add " -?" to what you have typed so far, you'll get to see the help text to remind you. You can then recall the last command typed, delete the -? option at the end, and continue typing in the command.

Example (Windows)
> d /?

Option Name    Description
-----------    -----------
-help          Show this help text
-version       Show program version
-verbose       Level of informational messages
-warning       Level of warning messages
-totals        Totals per directory only?
-resolution    Resolution (in bytes)
-files         Just print a list of full filenames?
-grand_total   Print grand_total?
-header        Print header for each new directory?
-sort_order    Sort order
-size          Size formatting options
-date          Date/time formatting options
-name          Filename formatting options
-directories   Select directory files  [no only also]
-hidden        Select hidden files [no only also]
-before        Select files from before this date/time
-since         Select files from after this date/time
-min_size      Minimum file size
-max_size      Maximum file size
-default       Default filename
-exclude       Files to exclude
-current_only  Current file versions only?
<params...>    Files to list
-output        Output file

See  http://doc.glindra.org/directory.html


-version

The -version option prints the name and current version of the program to stderr. To be able to find out the version number is useful when preparing bug reports, among other things.

Just like with the -help option, the program exits immediately after writing out the required information, without doing anything else.

The -version option cannot be abbreviated, and must be spelled out in full in the command line.

Example
> d -version
d -- Glindra directory command
Glindra C++ Library version 0.0.2 (pre-alpha)

-verbose   -v
-statistics
-noverbose

These option control the amount of informational messages that are written to stderr. There are three levels:

-verbose
Print out both log information and statistics.
-statistics
Statistics only, no log messages.
-noverbose
No log information and no statistics


For the basic utilities like cop, dele and pu, the default is -verbose.

Example (Windows)

The cop command normally produces output like this:

> cop ***\*tok*.?pp temp\*** 
Copied to:   temp\tokenizer.hpp
Copied to:   temp\token_iterator.hpp
Copied to:   temp\token_functions.hpp
Copied to:   temp\pending\stringtok.hpp
  19 kb copied, 4 files in 2 directories


With the -statistics option you suppress the log messages, and just get the statistics:

> cop ***\*tok*.?pp temp\*** -stat
  19 kb copied, 4 files in 2 directories


With the -noverbose option you suppress both the log messages and the statistics:

> cop ***\*tok*.?pp temp\*** -noverbose

-warning
-nowarning
-noerror

These options control the amount of informational messages that are written to stderr. There are three levels:

-warning
Print both error and warning messages.
-nowarning
Suppress warning messages, but print error messages.
-noerror
Suppress both warning and error messages.


The default is -warning.

Fatal error messages are always written out, even if -noerror has been specified.

Example (Linux)

The cop command generates a warning if it cannot find an input file. In this example, there is no file that matches ***/*toc*.?pp.

cop generates an error if the output file cannot be opened. In this example it cannot open the output files because they already exist, and the output file specification contains the .* version wildcard, which suppresses the automatic version number handling.


Normally, the output from cop would look like this:

> cop ('***/*toc*.?pp' '*tok*') 'temp/***/*.*.*'
[warning] No such file: ***/*toc*.?pp
[ERROR] File already exists: temp/tokenizer.hpp
[ERROR] File already exists: temp/token_iterator.hpp
[ERROR] File already exists: temp/token_functions.hpp
[ERROR] File already exists: temp/pending/stringtok.hpp
  No files copied


With the -nowarning option, the warning about the non-existent file is suppressed, but the error messages are written out.

> cop ('***/*toc*.?pp' '*tok*') 'temp/***/*.*.*' -nowarning
[ERROR] File already exists: temp/tokenizer.hpp
[ERROR] File already exists: temp/token_iterator.hpp
[ERROR] File already exists: temp/token_functions.hpp
[ERROR] File already exists: temp/pending/stringtok.hpp
  No files copied


With the -noerror option, both the warning and the error messages are suppressed:

> cop ('***/*toc*.?pp' '*tok*') 'temp/***/*.*.*' -noerror
  No files copied

To suppress all output, whether the copy operation is successful or not, use both -noerror and -noverbose:

> cop ('***/*toc*.?pp' '*tok*') 'temp/***/*.*.*' -noerror -noverbose
At last there is silence.