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>
This commit is contained in:
parent
59332d13b2
commit
ac1d33dd02
@ -762,8 +762,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
|
|||||||
struct option options[] = {
|
struct option options[] = {
|
||||||
OPT_BOOLEAN(0, "cached", &cached,
|
OPT_BOOLEAN(0, "cached", &cached,
|
||||||
"search in index instead of in the work tree"),
|
"search in index instead of in the work tree"),
|
||||||
OPT_BOOLEAN(0, "index", &use_index,
|
{ OPTION_BOOLEAN, 0, "index", &use_index, NULL,
|
||||||
"--no-index finds in contents not managed by git"),
|
"finds in contents not managed by git",
|
||||||
|
PARSE_OPT_NOARG | PARSE_OPT_NEGHELP },
|
||||||
OPT_GROUP(""),
|
OPT_GROUP(""),
|
||||||
OPT_BOOLEAN('v', "invert-match", &opt.invert,
|
OPT_BOOLEAN('v', "invert-match", &opt.invert,
|
||||||
"show non-matching lines"),
|
"show non-matching lines"),
|
||||||
|
Loading…
Reference in New Issue
Block a user