Skip to content

Commit bc32aa1

Browse files
committed
Merge branch 'ab/parse-options-cleanup'
Change the type of an internal function to return an enum (instead of int) and replace -2 that was used to signal an error with -1. * ab/parse-options-cleanup: parse-options.c: use "enum parse_opt_result" for parse_nodash_opt()
2 parents 15209c8 + 68611f5 commit bc32aa1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

parse-options.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,9 @@ static enum parse_opt_result parse_long_opt(
404404
return PARSE_OPT_UNKNOWN;
405405
}
406406

407-
static int parse_nodash_opt(struct parse_opt_ctx_t *p, const char *arg,
408-
const struct option *options)
407+
static enum parse_opt_result parse_nodash_opt(struct parse_opt_ctx_t *p,
408+
const char *arg,
409+
const struct option *options)
409410
{
410411
const struct option *all_opts = options;
411412

@@ -415,7 +416,7 @@ static int parse_nodash_opt(struct parse_opt_ctx_t *p, const char *arg,
415416
if (options->short_name == arg[0] && arg[1] == '\0')
416417
return get_value(p, options, all_opts, OPT_SHORT);
417418
}
418-
return -2;
419+
return PARSE_OPT_ERROR;
419420
}
420421

421422
static void check_typos(const char *arg, const struct option *options)

0 commit comments

Comments
 (0)