parse-options: let OPT__FORCE take optional flags argument
--force option is most likely hidden from command line completion for safety reasons. This is done by adding an extra flag PARSE_OPT_NOCOMPLETE. Update OPT__FORCE() to accept additional flags. Actual flag change comes later depending on individual commands. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
2de37349d9
commit
1224781d60
@ -248,7 +248,7 @@ extern int parse_opt_passthru_argv(const struct option *, const char *, int);
|
||||
{ OPTION_CALLBACK, 'q', "quiet", (var), NULL, N_("be more quiet"), \
|
||||
PARSE_OPT_NOARG, &parse_opt_verbosity_cb, 0 }
|
||||
#define OPT__DRY_RUN(var, h) OPT_BOOL('n', "dry-run", (var), (h))
|
||||
#define OPT__FORCE(var, h) OPT_COUNTUP('f', "force", (var), (h))
|
||||
#define OPT__FORCE(var, h, f) OPT_COUNTUP_F('f', "force", (var), (h), (f))
|
||||
#define OPT__ABBREV(var) \
|
||||
{ OPTION_CALLBACK, 0, "abbrev", (var), N_("n"), \
|
||||
N_("use <n> digits to display SHA-1s"), \
|
||||
|
Reference in New Issue
Block a user