www.delorie.com/gnu/docs/glibc/libc_541.html   search  
 
Buy the book!


The GNU C Library

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

25.3.8 Customizing Argp Help Output

The help_filter field in a struct argp is a pointer to a function that filters 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 section 25.3.4 Specifying Options in an Argp Parser. Alternately, one of the special keys with names beginning with `ARGP_KEY_HELP_' might be used, describing which other help text text will contain. See section 25.3.8.1 Special Keys for Argp Help Filter Functions.

The function should return either text if it remains as-is, or a replacement string allocated using malloc. This will be either be freed by argp or zero, which prints nothing. The value of text is supplied after any translation has been done, so if any of the replacement text needs translation, it will be done by the filter function. input is either the input supplied to argp_parse or it is zero, if argp_help was called directly by the user.

25.3.8.1 Special Keys for Argp Help Filter Functions  Special key values for help filter functions.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003