git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Ratterman <jratt0@gmail.com>
To: gitster@pobox.com, git@vger.kernel.org
Cc: Joe Ratterman <jratt0@gmail.com>
Subject: [PATCH] grep: Add the option '--line-number'
Date: Mon, 28 Mar 2011 13:11:55 -0500	[thread overview]
Message-ID: <1301335915-5782-1-git-send-email-jratt0@gmail.com> (raw)

This is a synonym for the existing '-n' option, matching GNU grep.

Signed-off-by: Joe Ratterman <jratt0@gmail.com>
---
 Documentation/git-grep.txt |    1 +
 builtin/grep.c             |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 71668e0..c446590 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -102,6 +102,7 @@ OPTIONS
 	as a regex).
 
 -n::
+--line-number::
 	Prefix the line number to matching lines.
 
 -l::
diff --git a/builtin/grep.c b/builtin/grep.c
index 1d35f76..c51e9f1 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -874,7 +874,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 		OPT_BOOLEAN('F', "fixed-strings", &opt.fixed,
 			"interpret patterns as fixed strings"),
 		OPT_GROUP(""),
-		OPT_BOOLEAN('n', NULL, &opt.linenum, "show line numbers"),
+		OPT_BOOLEAN('n', "line-number", &opt.linenum, "show line numbers"),
 		OPT_NEGBIT('h', NULL, &opt.pathname, "don't show filenames", 1),
 		OPT_BIT('H', NULL, &opt.pathname, "show filenames", 1),
 		OPT_NEGBIT(0, "full-name", &opt.relative,
-- 
1.7.4.1.4.g0ea33

             reply	other threads:[~2011-03-28 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 18:11 Joe Ratterman [this message]
2011-03-28 21:02 ` [PATCH] grep: Add the option '--line-number' Junio C Hamano

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

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

  git send-email \
    --in-reply-to=1301335915-5782-1-git-send-email-jratt0@gmail.com \
    --to=jratt0@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
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 NNTP newsgroup(s).