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

7.10.4 environment variable presets

If the AutoOpts client program specifies environrc in its option descriptor file, then environment variables will be used for presetting option state. Variables will be looked for that are named, PROGRAM_OPTNAME and PROGRAM. PROGRAM is the upper cased C-name of the program, and OPTNAME is the upper cased C-name of a specific option. (The C-names are the regular names with all special characters converted to underscores (_).)

Option specific environment variables are processed after (and thus take precedence over) the contents of the PROGRAM environment variable. The option argument string for these options takes on the string value gotten from the environment. Consequently, you can only have one instance of the OPTNAME.

If a particular option may be disabled, then its disabled state is indicated by setting the PROGRAM_OPTNAME value to the disablement prefix. So, for example, if the disablement prefix were dont, then you can disable the optname option by setting the PROGRAM_OPTNAME’ environment variable to dont. See section Common Option Attributes.

The PROGRAM environment string is tokenized and parsed much like a command line. Doubly quoted strings have backslash escapes processed the same way they are processed in C program constant strings. Singly quoted strings are pretty raw in that backslashes are honored before other backslashes, apostrophes, newlines and cr/newline pairs. The options must be introduced with hyphens in the same way as the command line.

Note that not all options may be preset. Options that are specified with the no-preset attribute and the ‘--help’, ‘--more-help’, and ‘--save-opts’ auto-supported options may not be preset.

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

This document was generated by Bruce Korb on August 21, 2015 using texi2html 1.82.