25.3.2 Argp Global Variables

These variables make it easy for user programs to implement the
‘--version’ option and provide a bug-reporting address in the
‘--help’ output. These are implemented in argp by default.

Variable: const char *argp_program_version

If defined or set by the user program to a non-zero value, then a
‘--version’ option is added when parsing with argp_parse,
which will print the ‘--version’ string followed by a newline and
exit. The exception to this is if the ARGP_NO_EXIT flag is used.

Variable: const char *argp_program_bug_address

If defined or set by the user program to a non-zero value,
argp_program_bug_address should point to a string that will be
printed at the end of the standard output for the ‘--help’ option,
embedded in a sentence that says ‘Report bugs to address.’.

Variable: argp_program_version_hook

If defined or set by the user program to a non-zero value, a
‘--version’ option is added when parsing with arg_parse,
which prints the program version and exits with a status of zero. This
is not the case if the ARGP_NO_HELP flag is used. If the
ARGP_NO_EXIT flag is set, the exit behavior of the program is
suppressed or modified, as when the argp parser is going to be used by
other programs.