summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Wesarg <bert.wesarg@googlemail.com>2011-09-15 20:26:02 +0200
committerJunio C Hamano <gitster@pobox.com>2011-09-15 12:17:56 -0700
commitac1d33dd0205c52fb168ddaa53b40aeb6f1ea7b5 (patch)
treee5e22818ff147cff94b7dfee42692b0f01e92d8a
parent59332d13b2b23840452180368914921bffe9bfbc (diff)
downloadgit-ac1d33dd0205c52fb168ddaa53b40aeb6f1ea7b5.tar.gz
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>
-rw-r--r--builtin-grep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index 0ef849cb84..e3eeb77cc7 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -762,8 +762,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
struct option options[] = {
OPT_BOOLEAN(0, "cached", &cached,
"search in index instead of in the work tree"),
- OPT_BOOLEAN(0, "index", &use_index,
- "--no-index finds in contents not managed by git"),
+ { OPTION_BOOLEAN, 0, "index", &use_index, NULL,
+ "finds in contents not managed by git",
+ PARSE_OPT_NOARG | PARSE_OPT_NEGHELP },
OPT_GROUP(""),
OPT_BOOLEAN('v', "invert-match", &opt.invert,
"show non-matching lines"),