Skip to content

Commit 1b88735

Browse files
avargitster
authored andcommitted
parse-options.c: use exhaustive "case" arms for "enum parse_opt_result"
Change the "default" case in parse_options() that handles the return value of parse_options_step() to simply have a "case" arm for PARSE_OPT_UNKNOWN, instead of leaving it to a comment. This means the compiler can warn us about any missing case arms. This adjusts code added in ff43ec3 (parse-opt: create parse_options_step., 2008-06-23), given its age it may pre-date the existence (or widespread use) of this coding style, which we've since adopted more widely. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 352e761 commit 1b88735

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parse-options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ enum parse_opt_result parse_options(int argc, const char **argv,
866866
case PARSE_OPT_NON_OPTION:
867867
case PARSE_OPT_DONE:
868868
break;
869-
default: /* PARSE_OPT_UNKNOWN */
869+
case PARSE_OPT_UNKNOWN:
870870
if (ctx.argv[0][1] == '-') {
871871
error(_("unknown option `%s'"), ctx.argv[0] + 2);
872872
} else if (isascii(*ctx.opt)) {

0 commit comments

Comments
 (0)