diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-08-17 22:09:56 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-17 22:09:56 +0200 |
commit | 8963bb0c2d023738f8ea021b512ed83cd79ee754 (patch) | |
tree | fbf8f5e69b46d4a01a9b26c0b2434c4be3de5d4d /parse-options.c | |
parent | Merge branch 'ab/fetch-nego' (diff) | |
parent | parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP (diff) | |
download | git-8963bb0c2d023738f8ea021b512ed83cd79ee754.tar.xz git-8963bb0c2d023738f8ea021b512ed83cd79ee754.zip |
Merge branch 'rs/parse-opt-lithelp'
The parse-options machinery learned to refrain from enclosing
placeholder string inside a "<bra" and "ket>" pair automatically
without PARSE_OPT_LITERAL_ARGHELP. Existing help text for option
arguments that are not formatted correctly have been identified and
fixed.
* rs/parse-opt-lithelp:
parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP
shortlog: correct option help for -w
send-pack: specify --force-with-lease argument help explicitly
pack-objects: specify --index-version argument help explicitly
difftool: remove angular brackets from argument help
add, update-index: fix --chmod argument help
push: use PARSE_OPT_LITERAL_ARGHELP instead of unbalanced brackets
Diffstat (limited to 'parse-options.c')
-rw-r--r-- | parse-options.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/parse-options.c b/parse-options.c index 7db84227ab..3b874a83a0 100644 --- a/parse-options.c +++ b/parse-options.c @@ -660,7 +660,8 @@ int parse_options(int argc, const char **argv, const char *prefix, static int usage_argh(const struct option *opts, FILE *outfile) { const char *s; - int literal = (opts->flags & PARSE_OPT_LITERAL_ARGHELP) || !opts->argh; + int literal = (opts->flags & PARSE_OPT_LITERAL_ARGHELP) || + !opts->argh || !!strpbrk(opts->argh, "()<>[]|"); if (opts->flags & PARSE_OPT_OPTARG) if (opts->long_name) s = literal ? "[=%s]" : "[=<%s>]"; |