Skip to content

Commit 078c425

Browse files
rscharfegitster
authored andcommitted
name-rev: use OPT_HIDDEN_BOOL for --peel-tag
adfc185 (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. 4741edd (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43c8a30 commit 078c425

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

builtin/name-rev.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,8 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
582582
OPT_BOOL(0, "undefined", &allow_undefined, N_("allow to print `undefined` names (default)")),
583583
OPT_BOOL(0, "always", &always,
584584
N_("show abbreviated commit object as fallback")),
585-
{
586-
/* A Hidden OPT_BOOL */
587-
OPTION_SET_INT, 0, "peel-tag", &peel_tag, NULL,
588-
N_("dereference tags in the input (internal use)"),
589-
PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1,
590-
},
585+
OPT_HIDDEN_BOOL(0, "peel-tag", &peel_tag,
586+
N_("dereference tags in the input (internal use)")),
591587
OPT_END(),
592588
};
593589

0 commit comments

Comments
 (0)