Go to the first, previous, next, last section, table of contents.


Combining Multiple Argp Parsers

The children field in a struct argp allows other argp parsers to be combined with the referencing one to parse a single set of arguments. It should point to a vector of struct argp_child, terminated by an entry having a value of zero in the argp field.

Where conflicts between combined parsers arise (for instance, if two specify an option with the same name), they are resolved in favor of the parent argp parsers, or earlier argp parsers in the list of children.

Data Type: struct argp_child
An entry in the list of subsidiary argp parsers pointed to by the children field in a struct argp. The fields are as follows:

const struct argp *argp
The child argp parser, or zero to end the list.
int flags
Flags for this child.
const char *header
If non-zero, an optional header to be printed in help output before the child options. As a side-effect, a non-zero value forces the child options to be grouped together; to achieve this effect without actually printing a header string, use a value of "". As with header strings specified in an option entry, the value conventionally has `:' as the last character. See section Specifying Options in an Argp Parser.
int group
Where to group the child options relative to the other (`consolidated') options in the parent argp parser. The values are the same as the group field in struct argp_option (see section Specifying Options in an Argp Parser), but all child-groupings follow parent options at a particular group level. If both this field and header are zero, then the child's options aren't grouped together at all, but rather merged with the parent options (merging the child's grouping levels with the parents).


Go to the first, previous, next, last section, table of contents.