Re: [PATCH 6/6] parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 2, 2018, 20:05 UTC
- Message-ID
- <xmqqva8szg7u.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <757ca573-3954-9c31-8a7b-56a2de8e3793@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 11 quoted lines
> 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, "()<>[]|");Good that you did not include '-' in there, as that would have broken a multi-word-placeholder.
All other changes in this patch looked sensible, too.