Node:Argp Help Filtering, Previous:Argp Children, Up:Argp Parsers



Customizing Argp Help Output

The help_filter field in a struct argp is a pointer to a function to filter the text of help messages before displaying them. They have a function signature like:

char *help-filter (int key, const char *text, void *input)
where key is either a key from an option, in which case text is that option's help text (see Argp Option Vectors), or one of the special keys with names beginning with ARGP_KEY_HELP_, describing which other help text text is (see Argp Help Filter Keys). The function should return either text, if it should be used as-is, a replacement string, which should be allocated using malloc, and will be freed by argp, or zero, meaning `print nothing'. The value of text supplied is after any translation has been done, so if any of the replacement text also needs translation, that should be done by the filter function. input is either the input supplied to argp_parse, or zero, if argp_help was called directly by the user.