]> git.ipfire.org Git - thirdparty/git.git/commitdiff
parse-options: require PARSE_OPT_NOARG for OPTION_BITOP
authorRené Scharfe <l.s.r@web.de>
Wed, 9 Jul 2025 09:44:09 +0000 (11:44 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Jul 2025 15:39:00 +0000 (08:39 -0700)
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>
parse-options.c

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