@matheusbsbs / matheus-bagliano / commits / 7d6cb10b84
Fork 0

grep: Add the option '--line-number'

This is a synonym for the existing '-n' option, matching GNU grep. Signed-off-by: Joe Ratterman <jratt0@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Joe Ratterman committed Mar 28, 2011 at 13:11 UTC 7d6cb10b84d9931aacf1914db192cbeaaa88443d
2 files changed +2 -1
Documentation/git-grep.txt
+1
@@ -93,6 +93,7 @@ OPTIONS
93 as a regex).
94
95 -n::
96 +--line-number::
97 Prefix the line number to matching lines.
98
99 -l::
builtin/grep.c
+1 -1
@@ -864,7 +864,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
864 OPT_BOOLEAN('F', "fixed-strings", &opt.fixed,
865 "interpret patterns as fixed strings"),
866 OPT_GROUP(""),
867 - OPT_BOOLEAN('n', NULL, &opt.linenum, "show line numbers"),
867 + OPT_BOOLEAN('n', "line-number", &opt.linenum, "show line numbers"),
868 OPT_NEGBIT('h', NULL, &opt.pathname, "don't show filenames", 1),
869 OPT_BIT('H', NULL, &opt.pathname, "show filenames", 1),
870 OPT_NEGBIT(0, "full-name", &opt.relative,