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>
Bert Wesarg committed
Sep 15, 2011 at 20:26 UTC
ac1d33dd0205c52fb168ddaa53b40aeb6f1ea7b5
1 file changed
+3
-2
builtin-grep.c
+3
-2
@@ -762,8 +762,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
762
struct option options[] = {
763
OPT_BOOLEAN(0, "cached", &cached,
764
"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 },
768
OPT_GROUP(""),
769
OPT_BOOLEAN('v', "invert-match", &opt.invert,
770
"show non-matching lines"),