| Commit message (Collapse) | Author | Age | Lines |
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
| |
Reported-by: terdon <https://linux.codidact.com/users/57088>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
As in pcre2grep(1) and grep(1).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
|
| |
This leaves -c unused, so we can add -c with the same meaning of
grep(1): count.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
|
|
| |
Since 2be04e240dea ("bin/grepc: Optimize"), we color also in ther types
of code. Update the manual page.
Fixes: 2be04e240dea ("bin/grepc: Optimize")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
To avoid confusion to users of other kernels.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
This ensures we own the file, removing any races.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
These flags are passed to pcre2grep(1).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
|
| |
This is to allow adding options that have arguments that are passed to
pcre2grep(1).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
Equivalent to grep(1)'s -h, except that we always default to -H behavior.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
|
|
| |
There's already a manual page, and the short help from -h was quite
unhelpful. I want to reuse -h for grep(1)'s meaning (don't print the
filename).
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
Use single-letter names for variables that hold command-line options.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The non-recursive behavior is so slow that it's quite useless. It is
only useful when reading from standard input, but for several files it's
useless. Make '-r' the default when any files are specified, and remove
the flag (since now it's always enabled). This happens to bring back a
behavior close to what we had before
55dd5d7255c8 ("Don't find files recursively").
Non-seekable files can still be read, if redirected to standard input.
Update the example from the manual page to reflect current usage.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Call pcre2grep(1) only once, which allows removing named pipes. This is
an important optimization, and will also allow accepting several file
names in the command line (in a future commit). The source code is also
significantly simplified.
It has a caveat: this single call to pcre2grep(1) will consume more
resources, and will crash on certain input files. The workaround is to
restrict the search to just one or a few types of code. Document this
in the manual page. This caveat only applies to very specific files,
which so far I've only found in the Linux kernel source tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
grep only one file (or stdin).
The current implementation doesn't allow filterin standard input, which
I miss some times. I'm removing this feature now, to be able to rewrite
most of the program in a way that allows filtering stdin, and then will
consider adding back a recursive mode if necessary.
Also, don't remove the two blanks at the start of the output, for
consistency when calling this program via xargs(1), which will become
more common now that it only handles single files.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
|
| |
This program shouldn't know about file names. If that is wanted, use
something like `find ... | grep ... | xargs grepc ...`.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
|
| |
This program shouldn't know about file extensions. If that is wanted,
use something like `find ... | grep ... | xargs grepc ...`.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
macros, or other macros
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
Also, use names consistent with the command-line option arguments.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
Also, use names consistent with the command-line option arguments.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|