]> git.ipfire.org Git - thirdparty/git.git/commitdiff
name-rev: use OPT_HIDDEN_BOOL for --peel-tag
authorRené Scharfe <l.s.r@web.de>
Sat, 2 Sep 2023 18:38:34 +0000 (20:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Sep 2023 21:58:44 +0000 (14:58 -0700)
adfc1857bd (describe: fix --contains when a tag is given as input,
2013-07-18) added the option --peel-tag, defining it using a positional
struct option initializer and a comment indicating that it's intended to
be a hidden OPT_BOOL.  4741edd549 (Remove deprecated OPTION_BOOLEAN for
parsing arguments, 2013-08-03) added the macro OPT_HIDDEN_BOOL, which
allows to express this more succinctly.  Use it.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/name-rev.c

index c706fa37201aeabc5bdc3eb752a5be859490a42d..2dd1807c4e09f8dc7ff557c628fdd850dc653361 100644 (file)
@@ -582,12 +582,8 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
                OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
                OPT_BOOL(0, "always",     &always,
                           N_("show abbreviated commit object as fallback")),
-               {
-                       /* A Hidden OPT_BOOL */
-                       OPTION_SET_INT, 0, "peel-tag", &peel_tag, NULL,
-                       N_("dereference tags in the input (internal use)"),
-                       PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1,
-               },
+               OPT_HIDDEN_BOOL(0, "peel-tag", &peel_tag,
+                          N_("dereference tags in the input (internal use)")),
                OPT_END(),
        };