The third argument to argp parser functions (see section Argp Parser Functions) is a pointer to a struct argp_state
, which contains
information about the state of the option parsing.
const struct argp *const root_argp
struct argp
passed into argp_parse
by
the invoking program (see section Parsing Program Options with Argp), but instead an internal argp parser
that contains options implemented by argp_parse
itself (such as
`--help').
int argc
char **argv
int next
argv
of the next argument to be parsed. May be modified.
One way to consume all remaining arguments in the input is to set
state->next = state->argc
(perhaps after recording
the value of the next
field to find the consumed arguments).
Also, you can cause the current option to be re-parsed by decrementing
this field, and then modifying
state->argv[state->next]
to be the option that should
be reexamined.
unsigned flags
argp_parse
. May be modified, although some
flags may only take effect when argp_parse
is first invoked.
See section Flags for argp_parse
.
unsigned arg_num
ARGP_KEY_ARG
, this is the number of the current arg, starting at
0, and incremented after each such call returns. At all other times,
this is the number of such arguments that have been processed.
int quoted
argv
of the first argument following a
special `--' argument (which prevents anything following being
interpreted as an option). Only set once argument parsing has proceeded
past this point.
void *input
argp_parse
, in
the input argument.
void **child_inputs
state->child_inputs[i]
as
its state->input
field, where i is the index
of the child in the this parser's children
field. See section Combining Multiple Argp Parsers.
void *hook
char *name
argv[0]
, or program_invocation_name
if that is
unavailable.
FILE *err_stream
FILE *out_stream
err_stream
, and all other output (such as
`--help' output) to out_stream
. These are initialized to
stderr
and stdout
respectively (see section Standard Streams).
void *pstate
Go to the first, previous, next, last section, table of contents.