aboutsummaryrefslogtreecommitdiffstats
path: root/parse-options.h
diff options
context:
space:
mode:
authorStefan Beller <stefanbeller@googlemail.com>2013-08-03 13:51:18 +0200
committerJunio C Hamano <gitster@pobox.com>2013-08-05 11:32:17 -0700
commit4741edd549decfccc016fa4775b349fe94fdf4e5 (patch)
treefc5bfb57bf7065e7ca918dc45265840f54c7c18c /parse-options.h
parente6b722db099f435f21ce72b18f0d61dc3c778f1f (diff)
downloadgit-4741edd549decfccc016fa4775b349fe94fdf4e5.tar.gz
Remove deprecated OPTION_BOOLEAN for parsing arguments
As of b04ba2bb4 OPTION_BOOLEAN was deprecated. This commit removes all occurrences of OPTION_BOOLEAN. In b04ba2bb4 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>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/parse-options.h b/parse-options.h
index 2404e06732..aeab9aa103 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -22,9 +22,6 @@ enum parse_opt_type {
OPTION_FILENAME
};
-/* Deprecated synonym */
-#define OPTION_BOOLEAN OPTION_COUNTUP
-
enum parse_opt_flags {
PARSE_OPT_KEEP_DASHDASH = 1,
PARSE_OPT_STOP_AT_NON_OPTION = 2,
@@ -129,6 +126,8 @@ struct option {
#define OPT_SET_INT(s, l, v, h, i) { OPTION_SET_INT, (s), (l), (v), NULL, \
(h), PARSE_OPT_NOARG, NULL, (i) }
#define OPT_BOOL(s, l, v, h) OPT_SET_INT(s, l, v, h, 1)
+#define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \
+ (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}
#define OPT_SET_PTR(s, l, v, h, p) { OPTION_SET_PTR, (s), (l), (v), NULL, \
(h), PARSE_OPT_NOARG, NULL, (p) }
#define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \