parse-options: require PARSE_OPT_NOARG for OPTION_BITOP

OPTION_BITOP options don't take arguments.  Make sure they are declared
that way using the flag PARSE_OPT_NOARG.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2025-07-09 11:44:09 +02:00
committed by Junio C Hamano
parent 16bd9f20a4
commit 369e6d94b2

View File

@@ -591,6 +591,7 @@ static void parse_options_check(const struct option *opts)
case OPTION_NEGBIT: case OPTION_NEGBIT:
case OPTION_SET_INT: case OPTION_SET_INT:
case OPTION_NUMBER: case OPTION_NUMBER:
case OPTION_BITOP:
if ((opts->flags & PARSE_OPT_OPTARG) || if ((opts->flags & PARSE_OPT_OPTARG) ||
!(opts->flags & PARSE_OPT_NOARG)) !(opts->flags & PARSE_OPT_NOARG))
optbug(opts, "should not accept an argument"); optbug(opts, "should not accept an argument");