The first argument to the argp_parse
function is a pointer to a
struct argp
, which known as an argp parser:
const struct argp_option *options
argp_option
structures specifying which
options this argp parser understands; it may be zero if there are no
options at all. See section Specifying Options in an Argp Parser.
argp_parser_t parser
ARGP_ERR_UNKNOWN
.
See section Argp Parser Functions.
const char *args_doc
const char *doc
'\v'
, '\013'
) character. By
convention, the documentation before the options is just a short string
saying what the program does, and that afterwards is longer, describing
the behavior in more detail.
const struct argp_child *children
argp_children
structures specifying
additional argp parsers that should be combined with this one.
See section Combining Multiple Argp Parsers.
char *(*help_filter)(int key, const char *text, void *input)
const char *argp_domain
The options
, parser
, args_doc
, and doc
fields are usually all that are needed. If an argp parser is defined as
an initialized C variable, only the used fields need be specified in
the initializer--the rest will default to zero due to the way C
structure initialization works (this fact is exploited for most argp
structures, grouping the most-used fields near the beginning, so that
unused fields can simply be left unspecified).
Go to the first, previous, next, last section, table of contents.