# [PATCH] fix usage string for git grep

1 messages from 2008-07-20 to 2008-07-20. Participants: Jonathan Nieder.
Thread: https://gitlist.dev/t/14549

## Jonathan Nieder, 2008-07-20 19:13

Subject: [PATCH] fix usage string for git grep
Message-ID: <20080720141308.BIU48280@m4500-01.uchicago.edu>
URL: https://gitlist.dev/e/20080720141308.BIU48280%40m4500-01.uchicago.edu

```
Without this patch, git-grep gives confusing usage information:

	$ git grep --confused
	usage: git grep <option>* <rev>* [-e] <pattern> [<path>...]
	$ git grep HEAD pattern
	fatal: ambiguous argument 'pattern': unknown revision or path no
	t in the working tree.
	Use '--' to separate paths from revisions

So put <pattern> before the <rev>s, in accordance with actual correct
usage.  While we're changing the usage string, we might as well include
the "--" separating revisions and paths, too.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
---
	Thanks!

 builtin-grep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-grep.c b/builtin-grep.c
index 7bf6a71..631129d 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -498,7 +498,7 @@ static int grep_object(struct grep_opt *opt, const char **paths,
 }
 
 static const char builtin_grep_usage[] =
-"git grep <option>* <rev>* [-e] <pattern> [<path>...]";
+"git grep <option>* [-e] <pattern> <rev>* [[--] <path>...]";
 
 static const char emsg_invalid_context_len[] =
 "%s: invalid context length argument";
-- 
1.5.6.4.441.g4b4e9

```
