diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-01-27 07:35:27 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-27 16:28:18 -0800 |
commit | f41179f16ba2fc16e31be81518536008afe2e278 (patch) | |
tree | 4a602c0e5688814a2d6823649595f64e5f3588db /parse-options-cb.c | |
parent | parse-options: stop abusing 'callback' for lowlevel callbacks (diff) | |
download | tgif-f41179f16ba2fc16e31be81518536008afe2e278.tar.xz |
parse-options: avoid magic return codes
Give names to these magic negative numbers. Make parse_opt_ll_cb
return an enum to make clear it can actually control parse_options()
with different return values (parse_opt_cb can too, but nobody needs
it).
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options-cb.c')
-rw-r--r-- | parse-options-cb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/parse-options-cb.c b/parse-options-cb.c index e05bcea809..ec01ef722b 100644 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@ -170,10 +170,10 @@ int parse_opt_noop_cb(const struct option *opt, const char *arg, int unset) * "-h" output even if it's not being handled directly by * parse_options(). */ -int parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx, - const struct option *opt, int unset) +enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx, + const struct option *opt, int unset) { - return -2; + return PARSE_OPT_UNKNOWN; } /** |