[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.5.1 Program Description Attributes

The following global definitions are used to define attributes of the entire program. These generally alter the configuration or global behavior of the AutoOpts option parser. The first two are required of every program. The rest have been alphabetized. Except as noted, there may be only one copy of each of these definitions:

`prog-name'

This attribute is required. Variable names derived from this name are derived using string->c_name! (see section `string->c-name!' - map non-name chars to underscore).

`prog-title'

This attribute is required and may be any descriptive text.

`allow-errors'

The presence of this attribute indicates ignoring any command line option errors. This may also be turned on and off by invoking the macros ERRSKIP_OPTERR and ERRSTOP_OPTERR from the generated interface file.

`argument'

Specifies the syntax of the arguments that follow the options. It may not be empty, but if it is not supplied, then option processing must consume all the arguments. If it is supplied and starts with an open bracket ([), then there is no requirement on the presence or absence of command line arguments following the options. Lastly, if it is supplied and does not start with an open bracket, then option processing must not consume all of the command line arguments.

`environrc'

Indicates looking in the environment for values of variables named, PROGRAM_OPTNAME or PROGRAM, where PROGRAM is the upper cased C-name of the program and OPTNAME is the upper cased C-name of a specific option.

`export'

This string is inserted into the .h interface file. Generally used for global variables or #include directives required by flag_code text and shared with other program text. Do not specify your configuration header (`config.h') in this attribute or the include attribute, however. Instead, use config-header, below.

`config-header'

The contents of this attribute should be just the name of the configuration file. A "#include" naming this file will be inserted at the top of the generated header.

`homerc'

Specifies either a directory or a file using a specific path (like . or `/usr/local/share/progname') or an environment variable (like `$HOME/rc/' or `$PREFIX/share/progname') or the directory where the executable was found (`$$[/...]') to use to try to find the rcfile. Use as many as you like. The presence of this attribute activates the --save-opts and --load-opts options. See section configuration file presets.

`include'

This string is inserted into the .c file. Generally used for global variables required only by flag_code program text.

`long-opts'

Presence indicates GNU-standard long option processing. If any options do not have an option value (flag character) specified, and least one does specify such a value, then you must specify long-opts. If none of your options specify an option value (flag character) and you do not specify long-opts, then command line arguments are processed in "named option mode". This means that:

`prefix'

This value is inserted into all global names. This will disambiguate them if more than one set of options are to be compiled into a single program.

`rcfile'

Specifies the configuration file name. This is only useful if you have provided at least one homerc attribute. default: .<prog-name>rc

`version'

Specifies the program version and activates the VERSION option, See section Automatically Supported Options.

`guard-option-names'

AutoOpts generates macros that presume that there are no cpp macros with the same name as the option name. For example, if you have an option named, debug, then you must not use #ifdef DEBUG in your code. If you specify this attribute, every option name will be guarded. If the name is #define-d, then a warning will be issued and the name undefined. If you do not specify this and there is a conflict, you will get strange error messages.

This will produce code that will warn you when conflicts get hidden. The builder of your program may suppress these warnings by adding this define to the compile command line:

 
-DNO_OPTION_NAME_WARNINGS

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Bruce Korb on September, 30 2006 using texi2html 1.76.

Viewable With Any Browser   autogen Home