AutoGen: loading rc files

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

### loading rc files

Initialization files are enabled by specifying the program attribute `homerc` (see section 7.3.1 Program Description Attributes). The initialization values are identified by the long option name followed by white space and any associated value. The value, if any, will continue through the end of the last line not continued with a backslash. Leading and trailing white space is stripped.

Initialization files are selected both by the `homerc` entries and, optionally, via a command line option. The first component of the `homerc` entry may be an environment variable such as `$HOME`, or it may also be `$$` (two dollar sign characters) to specify the directory of the executable. For example:

    homerc = "$$/../share/autogen";

will cause the AutoOpts library to look in the normal autogen datadir for an initialization file.

The initialization files are processed in the order they are specified by the `homerc` attribute, so that each new file will normally override the settings of the previous files. This may be overridden by marking some options for `immediate action` (see section 7.3.4.4 Immediate Action Attributes). Any such options are acted upon in reverse order. The disabled `load-opts` (`--no-load-opts`) option, for example, is an immediate action option. Its presence in the last `homerc` file will prevent the processing of any prior `homerc` files because its effect is immediate.

Initialization file processing can be completely suppressed by specifying `--no-load-opts` on the command line, or `PROGRAM_LOAD_OPTS=no` in the environment.

Initialization files may be sectioned. If, for example, you have a collection of programs that work closely together and, likely, have a common set of options, these programs may use a single, sectioned, initialization file. It may be partitioned by lines that commence with the square open bracket (`[`). All text before the first such a line is always processed. Once such a line is found, the upper-cased c-variable-syntax program name will be compared against the text following that bracket. If there is a match and the next character after that is a square close bracket (`]`), then the section is processed and the file closed. Otherwise, the section is ignored and a matching section is searched for.

For exampe, if the `fumble-stumble` options had a sectioned RC file, then a line containing exactly `[FUMBLE_STUMBLE]` would be searched for.

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

This document was generated by Bruce Korb on February 23, 2004 using texi2html