diff options
author | René Scharfe <l.s.r@web.de> | 2018-08-02 21:18:14 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-03 08:36:20 -0700 |
commit | 5f0df44cd79a953c287ccb598896ea7aaa2cc9e3 (patch) | |
tree | d438018d4b5dec908b60bd46913e36a8e6304ade /builtin/shortlog.c | |
parent | shortlog: correct option help for -w (diff) | |
download | tgif-5f0df44cd79a953c287ccb598896ea7aaa2cc9e3.tar.xz |
parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP
Parseopt wraps argument help strings in a pair of angular brackets by
default, to tell users that they need to replace it with an actual
value. This is useful in most cases, because most option arguments
are indeed single values of a certain type. The option
PARSE_OPT_LITERAL_ARGHELP needs to be used in option definitions with
arguments that have multiple parts or are literal strings.
Stop adding these angular brackets if special characters are present,
as they indicate that we don't deal with a simple placeholder. This
simplifies the code a bit and makes defining special options slightly
easier.
Remove the flag PARSE_OPT_LITERAL_ARGHELP in the cases where the new
and more cautious handling suffices.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/shortlog.c')
-rw-r--r-- | builtin/shortlog.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 98508fc556..581293ee7b 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -268,8 +268,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) OPT_BOOL('e', "email", &log.email, N_("Show the email address of each author")), { OPTION_CALLBACK, 'w', NULL, &log, N_("<w>[,<i1>[,<i2>]]"), - N_("Linewrap output"), - PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, + N_("Linewrap output"), PARSE_OPT_OPTARG, &parse_wrap_args }, OPT_END(), }; |