From: Bert Wesarg Date: Thu, 15 Sep 2011 18:26:02 +0000 (+0200) Subject: grep: do not use --index in the short usage output X-Git-Tag: v1.7.8-rc0~89^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ac1d33dd0205c52fb168ddaa53b40aeb6f1ea7b5;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin-grep.c b/builtin-grep.c index 0ef849cb8..e3eeb77cc 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"),