X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=parse-options.h;h=f295a2cf858f4dbebc62e956878544ffdb7fbe58;hb=7b1042292d5dc18508213c3be888b740d02f02e3;hp=aba30671dccd9e90686363a766df3eb25d4a8e20;hpb=45c58ba00a9c4e31e94997b59fd8112f962fa222;p=git.git diff --git a/parse-options.h b/parse-options.h index aba30671d..f295a2cf8 100644 --- a/parse-options.h +++ b/parse-options.h @@ -36,6 +36,7 @@ enum parse_opt_option_flags { PARSE_OPT_LASTARG_DEFAULT = 16, PARSE_OPT_NODASH = 32, PARSE_OPT_LITERAL_ARGHELP = 64, + PARSE_OPT_NEGHELP = 128, }; struct option; @@ -80,6 +81,9 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset); * PARSE_OPT_LITERAL_ARGHELP: says that argh shouldn't be enclosed in brackets * (i.e. '') in the help message. * Useful for options with multiple parameters. + * PARSE_OPT_NEGHELP: says that the long option should always be shown with + * the --no prefix in the usage message. Sometimes + * useful for users of OPTION_NEGBIT. * * `callback`:: * pointer to the callback to use for OPTION_CALLBACK. @@ -141,6 +145,10 @@ extern int parse_options(int argc, const char **argv, const char *prefix, extern NORETURN void usage_with_options(const char * const *usagestr, const struct option *options); +extern NORETURN void usage_msg_opt(const char *msg, + const char * const *usagestr, + const struct option *options); + /*----- incremental advanced APIs -----*/ enum {