diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-12-15 18:39:54 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-15 18:39:54 +0100 |
commit | bc32aa1e63218b0011159af4703e1389354c69f9 (patch) | |
tree | ef71f37f6d61608d2853e9590830d719618f636b /parse-options.c | |
parent | Merge branch 're/color-default-reset' (diff) | |
parent | parse-options.c: use "enum parse_opt_result" for parse_nodash_opt() (diff) | |
download | git-bc32aa1e63218b0011159af4703e1389354c69f9.tar.xz git-bc32aa1e63218b0011159af4703e1389354c69f9.zip |
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()
Diffstat (limited to 'parse-options.c')
-rw-r--r-- | parse-options.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/parse-options.c b/parse-options.c index fc5b43ff0b..629e796349 100644 --- a/parse-options.c +++ b/parse-options.c @@ -404,8 +404,9 @@ is_abbreviated: return PARSE_OPT_UNKNOWN; } -static int parse_nodash_opt(struct parse_opt_ctx_t *p, const char *arg, - const struct option *options) +static enum parse_opt_result parse_nodash_opt(struct parse_opt_ctx_t *p, + const char *arg, + const struct option *options) { const struct option *all_opts = options; @@ -415,7 +416,7 @@ static int parse_nodash_opt(struct parse_opt_ctx_t *p, const char *arg, if (options->short_name == arg[0] && arg[1] == '\0') return get_value(p, options, all_opts, OPT_SHORT); } - return -2; + return PARSE_OPT_ERROR; } static void check_typos(const char *arg, const struct option *options) |