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

7.3 Developer and User Notes

AutoOpts has its conventional way of displaying option information that includes somewhat more information that the standard GNU method. AutoOpts will also print out a line of usage text for each option type when options are misspecified. GNU programs typically do not do this. These defaults can be changed on a per-program basis by adding either or both of the following in the option definition file:

 
gnu-usage;
no-misuse-usage;

Users may also override these settings with the AUTOOPTS_USAGE environment variable. It may be set to a comma or white space separated list of the following strings:

gnu

The format of the extended usage text will be displayed in GNU-normal form.

autoopts

The format of the extended usage will be in AutoOpts’ native layout.

no-misuse-usage

When an option error is made on the command line, the abbreviated usage text will be suppressed.

misuse-usage

When an option error is made on the command line, the abbreviated usage text will be shown.

The setting used is the last one seen. The autoopts and misuse-usage serve no purpose, unless the definition file entries were specified as above.

Note for developers:

The templates used to implement AutoOpts depend heavily upon token pasting. That mens that if you name an option, “debug”, for example, the generated header will expect to be able to emit #define macros such as this:

 
#define DESC(n) (autogenOptions.pOptDesc[INDEX_OPT_## n])

and expect DESC(DEBUG) to expand correctly into (autogenOptions.pOptDesc[INDEX_OPT_DEBUG]). If DEBUG is #defined to something else, then that something else will be in the above expansion.

If you discover you are having strange problems like this, you may wish to use some variation of the guard-option-names See section Program Description Attributes.


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

This document was generated by Bruce Korb on February 17, 2011 using texi2html 1.82.

Viewable With Any Browser   autogen Home