| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following global option definitions are used to define attributes of the entire program. 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:
string->c_name! (see section 3.5.43 `string->c-name!' - map non-name chars to underscore).
settable. The library client program will invoke the
SET_OPTION macro which will invoke a handler function that will
finally set these global variables.
ERRSKIP_OPTERR and ERRSTOP_OPTERR from the
generated interface file.
[), then there is no requirement on the presence or
absence of command line argument 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.
guile-main has been specified and if this is specified
as well, then this code will be inserted into the actual main()
procedure before gh_enter() is called.
copyright is a structured value containing three to five
values. If copyright is used, then the first three are required.
copyright = {
date = "1992-2001";
owner = "Bruce Korb";
eaddr = 'bkorb@gnu.org';
type = GPL;
};
|
PROGRAM is the upper cased C-name of the program and
OPTNAME is the upper cased C-name of the option. The
C-names are the regular names with all special characters
converted to underscores (_).
If a particular option may be disabled, then its disabled state
is indicated by setting the 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 7.4.2.2 Common Option Attributes.
#include directives required by
flag_code text and shared with other program text.
optionProcess() and will
invoke any code specified by this attribute. If this attribute
does not specify any code, then calls to the AutoOpts library procedure
export_options_to_guile() and then scm_shell() will
be inserted into inner_main().
.
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 loading rc files.
flag_code program text.
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:
- and -- are completely optional.
argument program attribute is disallowed.
homerc attribute.
default: .<prog-name>rc
Every RC file will be considered partitioned by lines that commence with
the square open bracket ([). All text before 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 foo-bar options had a sectioned RC file,
then a line containing [FOO_BAR] would be searched for.
test-main is short (3 or fewer characters), the
generated main() will call putBourneShell. That routine will emit
Bourne shell commands that can be eval-ed by a Bourne-derived shell to
incorporate the digested options into the shell's environment,
See section 7.8 AutoOpts for Shell Scripts. You would use it thus:
eval `./programopts $@`
if [ -z "${OPTION_CT}" ] ; then exit 1 ; fi
shift ${OPTION_CT}
|
test-main contains putShellParse, the
program will generate portable Bourne shell commands that will parse the
command line options. The expectation is that this result will be
copied into a shell script and used there, See section 7.8 AutoOpts for Shell Scripts.
optionUsage() does not work for you. If you specify
gnu_usage as the value of this attribute, for example,
you will use a procedure by that name for displaying usage.
Of course, you will need to provide that procedure.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |