From 201324becb0f2660708bbda5d47f0af6cce4dfa4 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 11 Oct 1995 23:42:50 +0000 Subject: (ARGP_HELP_*, argp_help): Renamed from ARGP_USAGE_* &c. (ARGP_HELP_STD_HELP): Use ARGP_HELP_SHORT_USAGE instead of ARGP_HELP_USAGE. --- libshouldbeinlibc/argp.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'libshouldbeinlibc/argp.h') diff --git a/libshouldbeinlibc/argp.h b/libshouldbeinlibc/argp.h index 239b39e1..4c9ad1da 100644 --- a/libshouldbeinlibc/argp.h +++ b/libshouldbeinlibc/argp.h @@ -201,23 +201,29 @@ struct argp_state error_t argp_parse (struct argp *argp, int argc, char **argv, unsigned flags, int *arg_index); -/* Flags for argp_usage: */ -#define ARGP_USAGE_USAGE 0x01 /* Print a Usage: message. */ -#define ARGP_USAGE_SEE 0x02 /* Print a `for more help...' message. */ -#define ARGP_USAGE_HELP 0x04 /* Print a long help message. */ -#define ARGP_USAGE_EXIT_ERR 0x08 /* Call exit(1) instead of returning. */ -#define ARGP_USAGE_EXIT_OK 0x10 /* Call exit(0) instead of returning. */ +/* Flags for argp_help: */ +#define ARGP_HELP_USAGE 0x01 /* Print a Usage: message. */ +#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */ +#define ARGP_HELP_SEE 0x04 /* Print a `for more help...' message. */ +#define ARGP_HELP_LONG 0x08 /* Print a long help message. */ +#define ARGP_HELP_EXIT_ERR 0x10 /* Call exit(1) instead of returning. */ +#define ARGP_HELP_EXIT_OK 0x20 /* Call exit(0) instead of returning. */ + +/* If used as a flag to argp_help, this has the same effect as + ARGP_HELP_EXIT_ERR. However it can be used to clear both types of exit + flags at once. */ +#define ARGP_HELP_EXIT (ARGP_HELP_EXIT_ERR | ARGP_HELP_EXIT_OK) /* The standard thing to do after a program command line parsing error. */ -#define ARGP_USAGE_STD \ - (ARGP_USAGE_USAGE | ARGP_USAGE_SEE | ARGP_USAGE_EXIT_ERR) +#define ARGP_HELP_STD_ERR \ + (ARGP_HELP_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR) /* The standard thing to do in response to a --help option. */ -#define ARGP_USAGE_STD_HELP \ - (ARGP_USAGE_USAGE | ARGP_USAGE_HELP | ARGP_USAGE_EXIT_OK) +#define ARGP_HELP_STD_HELP \ + (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK) /* Output a usage message for ARGP to STREAM. FLAGS are from the set - ARGP_USAGE_*. */ -void argp_usage (struct argp *argp, FILE *stream, unsigned flags); + ARGP_HELP_*. */ +void argp_help (struct argp *argp, FILE *stream, unsigned flags); /* Returns true if the option OPT is a valid short option. */ extern inline int -- cgit v1.2.3