Add --files-with-matches flag.

Closes #26.

Acts like --count but emits only the paths of files with matches,
suitable for piping to xargs. Both mmap and no-mmap searches terminate
after the first match is found. Documentation updated and tests added.
This commit is contained in:
Andrew Schwartzmeyer
2016-09-23 19:06:34 -07:00
parent 1595f0faf5
commit a8f3d9e87e
7 changed files with 96 additions and 9 deletions

View File

@@ -35,6 +35,11 @@ Only show count of line matches for each file.
.RS
.RE
.TP
.B \-l, \-\-files\-with\-matches
Only show path of each file with matches.
.RS
.RE
.TP
.B \-\-color \f[I]WHEN\f[]
Whether to use coloring in match.
Valid values are never, always or auto.

View File

@@ -29,6 +29,9 @@ the raw speed of grep.
-c, --count
: Only show count of line matches for each file.
-l, --files-with-matches
: Only show path of each file with matches.
--color *WHEN*
: Whether to use coloring in match. Valid values are never, always or auto.
[default: auto]