]> git.ipfire.org Git - thirdparty/git.git/blobdiff - parse-options.c
parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP
[thirdparty/git.git] / parse-options.c
index fca7159646c82cb9213e72afd94d8debc6bd4c51..2a2b97aec91e70577b7c81e83dd330a7a0681921 100644 (file)
@@ -562,7 +562,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>]";