parse-options: remove OPT_BOOLEAN
After a86a8b9 (sb/parseopt-boolean-removal), the deprecated OPT_BOOLEAN is not used anywhere except by OPT__* macros. Kill OPT_BOOLEAN and make OPT__* use OPT_COUNTUP directly instead. This should stop OPT_BOOLEAN from entering the tree again in new patches. OPT__DRY_RUN() is converted to use OPT_BOOL though because it does not make sense to increase the level of dryness. All OPT__DRY_RUN call sites have been checked and they look safe for OPT_BOOL. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Dec 7, 2013 at 12:02 UTC
212c0a6ff2993530a1dadee9dfbbce9dc350b1d1
1 file changed
+4
-7
parse-options.h
+4
-7
@@ -161,9 +161,6 @@ struct option {
161
N_("no-op (backward compatibility)"), \
162
PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, parse_opt_noop_cb }
163
164
-/* Deprecated synonym */
165
-#define OPT_BOOLEAN OPT_COUNTUP
166
-
164
/* parse_options() will filter out the processed options and leave the
165
* non-option arguments in argv[]. usagestr strings should be marked
166
* for translation with N_().
@@ -232,15 +229,15 @@ extern int parse_opt_tertiary(const struct option *, const char *, int);
229
extern int parse_opt_string_list(const struct option *, const char *, int);
230
extern int parse_opt_noop_cb(const struct option *, const char *, int);
231
235
-#define OPT__VERBOSE(var, h) OPT_BOOLEAN('v', "verbose", (var), (h))
236
-#define OPT__QUIET(var, h) OPT_BOOLEAN('q', "quiet", (var), (h))
232
+#define OPT__VERBOSE(var, h) OPT_COUNTUP('v', "verbose", (var), (h))
233
+#define OPT__QUIET(var, h) OPT_COUNTUP('q', "quiet", (var), (h))
234
#define OPT__VERBOSITY(var) \
235
{ OPTION_CALLBACK, 'v', "verbose", (var), NULL, N_("be more verbose"), \
236
PARSE_OPT_NOARG, &parse_opt_verbosity_cb, 0 }, \
237
{ OPTION_CALLBACK, 'q', "quiet", (var), NULL, N_("be more quiet"), \
238
PARSE_OPT_NOARG, &parse_opt_verbosity_cb, 0 }
242
-#define OPT__DRY_RUN(var, h) OPT_BOOLEAN('n', "dry-run", (var), (h))
243
-#define OPT__FORCE(var, h) OPT_BOOLEAN('f', "force", (var), (h))
239
+#define OPT__DRY_RUN(var, h) OPT_BOOL('n', "dry-run", (var), (h))
240
+#define OPT__FORCE(var, h) OPT_COUNTUP('f', "force", (var), (h))
241
#define OPT__ABBREV(var) \
242
{ OPTION_CALLBACK, 0, "abbrev", (var), N_("n"), \
243
N_("use <n> digits to display SHA-1s"), \