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>

René Scharfe committed Jul 9, 2025 at 11:44 UTC 369e6d94b21d238a203ffb702605f97aca5704c9
1 file changed +1
parse-options.c
+1
@@ -591,6 +591,7 @@ static void parse_options_check(const struct option *opts)
591 case OPTION_NEGBIT:
592 case OPTION_SET_INT:
593 case OPTION_NUMBER:
594 + case OPTION_BITOP:
595 if ((opts->flags & PARSE_OPT_OPTARG) ||
596 !(opts->flags & PARSE_OPT_NOARG))
597 optbug(opts, "should not accept an argument");