git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@uchicago.edu>
To: git@vger.kernel.org
Subject: [PATCH] fix usage string for git grep
Date: Sun, 20 Jul 2008 14:13:08 -0500 (CDT)	[thread overview]
Message-ID: <20080720141308.BIU48280@m4500-01.uchicago.edu> (raw)

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

                 reply	other threads:[~2008-07-20 19:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080720141308.BIU48280@m4500-01.uchicago.edu \
    --to=jrnieder@uchicago.edu \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).