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

7.5.2.2 AutoOpt-ed Library for Regular Program

In this case, your library must provide an option processing function to a calling program. This is accomplished by setting the allow-errors global option attribute. Each time your option handling function is called, you must determine where your scan is to resume and tell the AutoOpts library by invoking:

 
RESTART_OPT(next_arg_index);

and then invoke not_opt_index = optionProcess(...). The not_opt_index value can be used to set optind, if that is the global being used to scan the program argument array.

In this method, do NOT utilize the global library attribute. Your library must specify its options as if it were a complete program. You may choose to specify an alternate usage() function so that usage for other parts of the option interface may be displayed as well. See “Program Information Attributes” (see section Program Information Attributes).

At the moment, there is no method for calling optionUsage() telling it to produce just the information about the options and not the program as a whole. Some later revision after somebody asks.


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