| Commit message (Collapse) | Author | Age | Lines |
|
|
|
| |
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>
|
|
|
|
|
|
| |
These flags 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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
PCRE are EOL. Long live PCRE2.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
|
|
|
|
|
|
| |
of libc functions
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Also, add some symmetry between ${iflag} and ${lflag}.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Normally, one either wants to see a declaration/definition, or its
uses, but not both at the same time. Also, there are usually many
more use sites than than definitions, and therefore definitions
are shadowed between all the noise. Restrict the default to
declarations and definitions, which in my experience seems to be
the most common use case.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
`grepc '<filename>'` no longer produces that output (it now finds
more things). Use appropriate flags to keep the examples correct.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
|
|
| |
We have <share/licenses/> and <LICENSES/> in the repo, which
should be enough to let people find the license. Anyway, when
installed, different systems will likely have licenses installed
in different places. Let's remove probably incorrect data.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
It contained a relative path, that would need a complex Makefile
to keep correct after installation. Let's assume that
<share/doc/grepc/> is easy to find, as it follows FHS, and a bit
of intuition should do the rest.
Anyway, the manual page contains an example.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
Rename functions to have different starting letters. Also rename
the macro functions to more closely match ISO C nomenclature.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
| |
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Remove the leading blank lines.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
| |
Those are nice examples, but are a nightmare as filenames.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
Also, update the manual page EXAMPLES regarding blank lines.
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
| |
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
| |
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
| |
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
|
|
|
| |
Recent changes reduced the number of blank lines. Update the
examples to show that.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|
|
|
|
| |
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
|