[RFH/PATCH 4/4] OPT__FORCE(): clarify its expected use by using OPT_COUNTUP
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 6, 2013, 23:31 UTC
- Message-ID
- <1375831889-9610-5-git-send-email-gitster@pobox.com>
- In-Reply-To
- <1375831889-9610-1-git-send-email-gitster@pobox.com>
The parseopt parsing for OPT__FORCE() is implemented in terms of OPT_BOOLEAN() and users of it can take advantage of the "counting up" behaviour to implement increasing levels of forcefulness by differentiating "git cmd -f" and "git cmd -f -f".
Clarify this by explicitly using OPT_COUNTUP() instead.
Signed-off-by: Junio C Hamano <gitster@pobox.com> ---
* This _should_ be done with a similar audit of existing callers, but I ran out of concentration.
parse-options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parse-options.h b/parse-options.h index 78f52c2..1eeb0d9 100644 --- a/parse-options.h +++ b/parse-options.h @@ -238,7 +238,7 @@ extern int parse_opt_noop_cb(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_BOOLEAN('f', "force", (var), (h)) +#define OPT__FORCE(var, h) OPT_COUNTUP('f', "force", (var), (h)) #define OPT__ABBREV(var) \ { OPTION_CALLBACK, 0, "abbrev", (var), N_("n"), \ N_("use <n> digits to display SHA-1s"), \
-- 1.8.4-rc1-210-gf6d87e2