Skip to content

Commit ac1d33d

Browse files
bertwesarggitster
authored andcommitted
grep: do not use --index in the short usage output
Utilize the PARSE_OPT_NEGHELP option to show --no-index in the usage generated by parse-options. Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 59332d1 commit ac1d33d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

builtin-grep.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
762762
struct option options[] = {
763763
OPT_BOOLEAN(0, "cached", &cached,
764764
"search in index instead of in the work tree"),
765-
OPT_BOOLEAN(0, "index", &use_index,
766-
"--no-index finds in contents not managed by git"),
765+
{ OPTION_BOOLEAN, 0, "index", &use_index, NULL,
766+
"finds in contents not managed by git",
767+
PARSE_OPT_NOARG | PARSE_OPT_NEGHELP },
767768
OPT_GROUP(""),
768769
OPT_BOOLEAN('v', "invert-match", &opt.invert,
769770
"show non-matching lines"),

0 commit comments

Comments
 (0)