Next: AutoOpts Licensing, Up: Automated Option Processing [Contents][Index]
AutoOpts supports option processing; option state saving; and program documentation with innumerable features. Here, we list a few obvious ones and some important ones, but the full list is really defined by all the attributes defined in the Option Definitions section.
[PROGRAM_NAME]
or <?program-name>
, See configuration file presets.
<?auto-options [[option-text]]>
may be used to set AutoOpts
option processing options.
Viz., GNU usage layout versus AutoOpts
conventional layout,
and misuse-usage
versus no-misuse-usage
, See Usage and Version Info Display.
dis-abled
with a disablement prefix.
Such options may default to either an enabled or a disabled state. You
may also provide an enablement prefix, too, e.g., --allow-mumble
and --prevent-mumble (see Common Option Attributes).
xxx-value;
in
the option definition file. xxx
is the name of the option below:
These are always available. ‘--more-help’ will pass the full usage text through a pager.
This is added to the option list if usage-opt
is specified.
It yields the abbreviated usage to stdout.
This is added to the option list if version = xxx;
is specified.
These are added to the option list if homerc
is specified. Mostly.
If, disable-save
is specified, then --save-opts is disabled.
for-each
main that will invoke a named function once for either
each non-option argument on the command line or, if there are none,
then once for each non-blank, non-comment input line read from stdin.
subopts
)
(see Arg Type Hierarchical)
gnu-usage
attribute (see Program Information Attributes). This can be
overridden by the user himself with the AUTOOPTS_USAGE
environment
variable. If it exists and is set to the string ‘gnu’, it will force
GNU-ish style format; if it is set to the string ‘autoopts’, it will
force AutoOpts standard format; otherwise, it will have no effect.
embedded '\0' in format
. To eliminate the warning, you must
provide GCC with the -Wno-format-contains-nul option.
ENABLE_NLS
defined and _()
defined to a
localization function (e.g. gettext(3GNU)
), then the option processing
code will be localizable (see Internationalizing AutoOpts). Provided also that you do not define
the no-xlate
attribute to anything
(see User Presentation Attributes).
You should also ensure that the ATTRIBUTE_FORMAT_ARG()
gets
#define
-ed to something useful. There is an autoconf macro
named AG_COMPILE_FORMAT_ARG
in ag_macros.m4 that will
set it appropriately for you. If you do not do this, then translated
formatting strings may trigger GCC compiler warnings.
allow-errors
(see Program Description Attributes) attribute. When processing reaches a point
where optionProcess
(see optionProcess) needs to be called
again, the current option can be set with RESTART_OPT(n)
(see RESTART_OPT( n ) - Resume Option Processing) before calling optionProcess
.
See: See Options for Library Code.
#include
-d into the client option definitions
and they specify an "anchor" option that has a callback and must be invoked.
That will give the library access to the option state for their options.
#include
into their own option definitions.
See “AutoOpt-ed Library for AutoOpt-ed Program” (see AutoOpt-ed Library for AutoOpt-ed Program)
for more details.
Next: AutoOpts Licensing, Up: Automated Option Processing [Contents][Index]