]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/write-tree.c
parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP
authorRené Scharfe <l.s.r@web.de>
Thu, 2 Aug 2018 19:18:14 +0000 (21:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Aug 2018 15:36:20 +0000 (08:36 -0700)
commit5f0df44cd79a953c287ccb598896ea7aaa2cc9e3
treed438018d4b5dec908b60bd46913e36a8e6304ade
parentb8ade4c5766774207e05c8f92e262f8f6835bd3d
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>
builtin/add.c
builtin/pack-objects.c
builtin/read-tree.c
builtin/send-pack.c
builtin/shortlog.c
builtin/show-branch.c
builtin/update-index.c
builtin/write-tree.c
parse-options.c