Lines Matching refs:parser

4 @cindex argp (program argument parser)
20 result appear seamless. A library can export an argp option parser that
39 @c Optionally alloca()tes standard help options, initializes the parser,
52 @c group->parser (from argp->parser)
68 length @var{argc}, using the argp parser @var{argp}. @xref{Argp
73 @xref{Argp Flags}. @var{input} is passed through to the argp parser
76 parameters to the parser and passing back the results.
134 suppressed or modified, as when the argp parser is going to be used by
162 @code{struct argp}, which is known as an @dfn{argp parser}:
173 options this argp parser understands; it may be zero if there are no
176 @item argp_parser_t parser
177 A pointer to a function that defines actions for this parser; it is
185 this parser. This is only used to print the @samp{Usage:} message. If
215 Of the above group, @code{options}, @code{parser}, @code{args_doc}, and
217 parser is defined as an initialized C variable, only the fields used
224 * Options: Argp Option Vectors. Specifying options in an argp parser.
225 * Argp Parser Functions:: Defining actions for an argp parser.
227 * Help Filtering: Argp Help Filtering. Customizing help output for an argp parser.
235 that the argp parser supports. Multiple entries may be used for a single
242 This structure specifies a single option that an argp parser
255 The integer key provided by the current option to the option parser. If
332 option parser. It is an arbitrary section of documentation that should
361 The function pointed to by the @code{parser} field in a @code{struct
364 parser to perform tasks at certain other points during parsing.
367 Argp parser functions have the following type signature:
369 @cindex argp parser functions
371 error_t @var{parser} (int @var{key}, char *@var{arg}, struct argp_state *@var{state})
379 For each option that is parsed, @var{parser} is called with a value of
381 vector. @xref{Argp Option Vectors}. @var{parser} is also called at
391 one, an error results before @var{parser} ever gets called.
399 @var{parser}. @xref{Argp Parsing State}.
402 When @var{parser} is called, it should perform whatever action is
405 parser function, or a unix error code if a real error
410 Argp parser functions should return @code{ARGP_ERR_UNKNOWN} for any
416 A typical parser function uses a switch statement on @var{key}:
445 argument to argp parser functions may have a number of other special
447 parser function arguments. @xref{Argp Parser Functions}.
455 When there are multiple parser functions in play due to argp parsers
462 Once a parser function returns success for this key, that fact is
464 used. @emph{However}, if while processing the argument a parser function
471 If a parser function returns @code{ARGP_ERR_UNKNOWN} for
503 each parser to clean up its state for the parent.
508 non-option args, parser functions are called with this key if they
532 The final key ever seen by any parser, even after
540 In all cases, @code{ARGP_KEY_INIT} is the first key seen by parser
542 returned by the parser for @code{ARGP_KEY_INIT}. Other keys can occur
551 All non-option arguments were successfully handled by a parser
552 function. There may be multiple parser functions if multiple argp
558 This occurs when every parser function returns @code{ARGP_KEY_UNKNOWN}
567 If an error occurs and is either detected by argp or because a parser
568 function returned an error value, each parser is called with
575 The third argument to argp parser functions (@pxref{Argp Parser
585 The top level argp parser being parsed. Note that this is often
587 the invoking program. @xref{Argp}. It is an internal argp parser that
630 be the same length as the number of children in the current parser. Each
631 child parser will be given the value of
634 in the this parser's @code{children} field. @xref{Argp Children}.
637 For the parser function's use. Initialized to 0, but otherwise ignored
663 parser function. @xref{Argp Parsing State}.
671 Outputs the standard usage message for the argp parser referred to by
852 Outputs a help message for the argp parser referred to by @var{state},
864 This behavior is useful if an argp parser is exported for use by other
880 If a parser function will @emph{only} be used when @code{ARGP_NO_EXIT}
893 option with the same name, the parser conflicts are resolved in favor of
894 the parent argp parser(s), or the earlier of the argp parsers in the
905 The child argp parser, or zero to end of the list.
920 `consolidated' options in the parent argp parser. The values are the
1053 The argument doc string; formally the @code{args_doc} field from the argp parser. @xref{Argp Parse…
1071 This outputs a help message for the argp parser @var{argp} to
1078 an argp parser function. @xref{Argp Helper Functions}.
1116 The part of the argp parser doc string preceding the verbose option help.
1120 The part of the argp parser doc string that following the verbose option help.
1206 The variable @code{argp} contains the argument parser
1227 and specify @code{parse_opt} as the parser function. @xref{Argp Parser