diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-11-10 04:27:04 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-11 02:17:29 +0300 |
commit | 68611f512c143c15b4a3b968bb5b6ceb933c9ca6 (patch) | |
tree | 00387aa12446964804aa3a6cd72167b1084baaae /refs | |
parent | 06a199f38b50ccea198c29216c69bb389ca23391 (diff) |
parse-options.c: use "enum parse_opt_result" for parse_nodash_opt()
Change the parse_nodash_opt() function to use "enum
parse_opt_result". In 352e761388b (parse-options.[ch]: consistently
use "enum parse_opt_result", 2021-10-08) its only caller
parse_options_step() started using that return type, and the
get_value() which will be called and return from it uses the same
enum.
Let's do the same here so that this function always returns an "enum
parse_opt_result" value.
We could go for either PARSE_OPT_HELP (-2) or PARSE_OPT_ERROR (-1)
here. The reason we ended up with "-2" is that in code added in
07fe54db3cd (parse-opt: do not print errors on unknown options, return
"-2" instead., 2008-06-23) we used that value in a meaningful way.
Then in 51a9949eda7 (parseopt: add PARSE_OPT_NODASH, 2009-05-07) the
use of "-2" was seemingly copy/pasted from parse_long_opt(), which was
the function immediately above the parse_nodash_opt() function added
in that commit.
Since we only care about whether the return value here is non-zero
let's use the more generic PARSE_OPT_ERROR.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
0 files changed, 0 insertions, 0 deletions