From: Joe Ratterman Date: Mon, 28 Mar 2011 18:11:55 +0000 (-0500) Subject: grep: Add the option '--line-number' X-Git-Tag: v1.7.5-rc0~4^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7d6cb10b84d9931aacf1914db192cbeaaa88443d;p=git.git grep: Add the option '--line-number' This is a synonym for the existing '-n' option, matching GNU grep. Signed-off-by: Joe Ratterman Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index dab0a78fa..791d4d487 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -93,6 +93,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 34f9ae030..bb0f93208 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -864,7 +864,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,