Remove deprecated OPTION_BOOLEAN for parsing arguments
As ofb04ba2bb4
OPTION_BOOLEAN was deprecated. This commit removes all occurrences of OPTION_BOOLEAN. Inb04ba2bb4
Junio suggested to replace it with either OPTION_SET_INT or OPTION_COUNTUP instead. However a pattern, which occurred often with the OPTION_BOOLEAN was a hidden boolean parameter. So I defined OPT_HIDDEN_BOOL as an additional possible parse option in parse-options.h to make life easy. The OPT_HIDDEN_BOOL was used in checkout, clone, commit, show-ref. The only exception, where there was need to fiddle with OPTION_SET_INT was log and notes. However in these two files there is also a pattern, so we could think of introducing OPT_NONEG_BOOL. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e6b722db09
commit
4741edd549
@ -1073,9 +1073,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
|
||||
OPT_BOOLEAN('p', "patch", &opts.patch_mode, N_("select hunks interactively")),
|
||||
OPT_BOOL(0, "ignore-skip-worktree-bits", &opts.ignore_skipworktree,
|
||||
N_("do not limit pathspecs to sparse entries only")),
|
||||
{ OPTION_BOOLEAN, 0, "guess", &dwim_new_local_branch, NULL,
|
||||
N_("second guess 'git checkout no-such-branch'"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN },
|
||||
OPT_HIDDEN_BOOL(0, "guess", &dwim_new_local_branch,
|
||||
N_("second guess 'git checkout no-such-branch'")),
|
||||
OPT_END(),
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user