summaryrefslogtreecommitdiffstats
path: root/share (follow)
Commit message (Collapse)AuthorAgeLines
* bin/, man/: -m: Add flag, and pass it to pcre2grep(1)HEADmainAlejandro Colomar4 days-0/+5
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc, grepc.1: -c: Add option to count matchesAlejandro Colomar2023-11-05-0/+4
| | | | | | As in pcre2grep(1) and grep(1). Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc, grepc.1: Rename option -c to -rAlejandro Colomar2023-11-05-4/+5
| | | | | | | 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>
* grepc.1: -c: Remove outdated sentenceAlejandro Colomar2023-11-05-3/+0
| | | | | | | | 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>
* bin/grepc, grepc.1: Use 'l' instead of 's' for Linux system callsAlejandro Colomar2023-11-05-3/+3
| | | | | | To avoid confusion to users of other kernels. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc, grepc.1: -n: Add option to control printing of line numbersAlejandro Colomar2023-11-05-1/+5
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc, grepc.1: -A, -B, -C: Add flags for printing context.Alejandro Colomar2023-11-05-0/+15
| | | | | | These flags are passed to pcre2grep(1). Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc, grepc.1: -h: Add option to suppress prefixing file namesAlejandro Colomar2023-11-05-0/+3
| | | | | | Equivalent to grep(1)'s -h, except that we always default to -H behavior. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc, grepc.1: Remove -h flagAlejandro Colomar2023-11-05-3/+0
| | | | | | | | 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>
* bin/grepc, grepc.1: Always enable recursive mode; remove -rAlejandro Colomar2023-11-05-11/+12
| | | | | | | | | | | | | | | 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>
* Add recursive search back in with -rAlejandro Colomar2023-11-03-1/+10
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Allow specifying several filesAlejandro Colomar2023-11-03-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* bin/grepc: OptimizeAlejandro Colomar2023-11-03-0/+7
| | | | | | | | | | | | | 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.
* Don't find files recursivelyAlejandro Colomar2023-11-03-6/+4
| | | | | | | | | | | | | | | 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>
* Remove '-g' optionAlejandro Colomar2023-11-03-4/+0
| | | | | | | 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>
* Remove '-x' optionAlejandro Colomar2023-11-03-13/+0
| | | | | | | 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>
* bin/grepc, grepc.1: -tmf, -tmo: Add options to find only function-like ↵Alejandro Colomar2023-11-03-0/+8
| | | | | | macros, or other macros Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Use pcre2grep(1) instead of pcregrep(1)Alejandro Colomar2023-11-02-2/+2
| | | | | | PCRE are EOL. Long live PCRE2. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* grepc, grepc.1: -tg, -tgp, -tgd: Add more support for glibc internal names ↵Alejandro Colomar2022-08-17-0/+12
| | | | | | of libc functions Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -c: Add flag to color usesAlejandro Colomar2022-05-25-0/+7
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* CONTRIBUTING: Github repo was removedAlejandro Colomar2022-05-24-4/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -i flag as in grep(1)Alejandro Colomar2022-05-22-0/+4
| | | | | | Also, add some symmetry between ${iflag} and ${lflag}. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Remove -tu from the defaultsAlejandro Colomar2022-05-22-2/+2
| | | | | | | | | | | 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>
* grepc, grepc.1: -tu: Allow searching special charactersAlejandro Colomar2022-05-20-7/+15
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* examples/README: Fix commandAlejandro Colomar2022-05-17-2/+2
| | | | | | | `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>
* COPYING: Remove relative pathAlejandro Colomar2022-05-17-2/+0
| | | | | | | | | 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>
* README: Remove pointer to examples/Alejandro Colomar2022-05-17-3/+0
| | | | | | | | | | | 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>
* README, CONTRIBUTING: Move contrib info to CONTRIBUTINGAlejandro Colomar2022-05-17-16/+16
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -t...: Allow more granularityAlejandro Colomar2022-05-15-1/+39
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc.1: wfixAlejandro Colomar2022-05-15-2/+2
|
* grepc, grepc.1: wfixAlejandro Colomar2022-05-15-1/+1
| | | | | | | 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>
* grepc, grepc.1: -tu: Search also within enum and type definitionsAlejandro Colomar2022-05-15-2/+5
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -l flag as in grep(1)Alejandro Colomar2022-05-14-0/+6
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc.1: ffixAlejandro Colomar2022-05-13-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -tu to search for usesAlejandro Colomar2022-05-13-1/+8
| | | | | Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -k option for a more compact outputAlejandro Colomar2022-05-12-0/+5
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add -t option to restrict the search to a type of code.Alejandro Colomar2022-05-12-0/+27
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* examples/: ffixAlejandro Colomar2022-05-11-58/+0
| | | | | | Remove the leading blank lines. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* Makefile, examples/: Remove files with '\' in the filenameAlejandro Colomar2022-05-11-290/+0
| | | | | | Those are nice examples, but are a nightmare as filenames. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Don't print leading blank lines.Alejandro Colomar2022-05-11-4/+0
| | | | | | | Also, update the manual page EXAMPLES regarding blank lines. Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc.1: SYNOPSIS: ffixAlejandro Colomar2022-05-11-2/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: Add optional FILE trailing argumentsAlejandro Colomar2022-05-11-2/+20
| | | | | Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -g: Add option to restrict search to files tracked by gitAlejandro Colomar2022-05-11-0/+4
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -x: Add option to edit file extensionAlejandro Colomar2022-05-11-1/+8
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc, grepc.1: -h: Add option to print the usage message.Alejandro Colomar2022-05-11-0/+5
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* grepc.1: wfixAlejandro Colomar2022-05-10-2/+1
| | | | | Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* INSTALL: We don't use so many extensions nowAlejandro Colomar2022-05-10-4/+2
| | | | | Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* examples/: Update examples regarding blank linesAlejandro Colomar2022-05-10-184/+0
| | | | | | | Recent changes reduced the number of blank lines. Update the examples to show that. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* examples/linux/: Add '\w*SYSCALL_DEFINE\w*'Alejandro Colomar2022-05-10-0/+321
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
* INSTALL: Document all of the install-% targetsAlejandro Colomar2022-05-10-0/+2
| | | | Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>