From 29f25d493c1021a53acf41e5763e732217dd75c3 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Thu, 21 May 2009 00:33:17 -0700 Subject: parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's Usually, the argh element in struct option points at a placeholder value (e.g. "val"), and is shown in the usage message as --option= by enclosing the string inside of angle brackets. When the option is more complex (e.g. optional arguments separated by a comma), you would want to produce a usage message that looks like --option=[,] In such a case, the caller can pass a string to argh with placeholders already enclosed in necessary angle brackets (e.g. "[,]") and set this flag. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- parse-options.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'parse-options.h') diff --git a/parse-options.h b/parse-options.h index b54eec128b..910aa1e9f1 100644 --- a/parse-options.h +++ b/parse-options.h @@ -31,6 +31,7 @@ enum parse_opt_option_flags { PARSE_OPT_NONEG = 4, PARSE_OPT_HIDDEN = 8, PARSE_OPT_LASTARG_DEFAULT = 16, + PARSE_OPT_LITERAL_ARGHELP = 64, }; struct option; @@ -66,6 +67,9 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset); * PARSE_OPT_NONEG: says that this option cannot be negated * PARSE_OPT_HIDDEN this option is skipped in the default usage, showed in * the long one. + * 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. * * `callback`:: * pointer to the callback to use for OPTION_CALLBACK. -- cgit v1.2.3