cgrep - grep with colors without the grep
USAGE
cgrep <regex>
DESCRIPTION
grep is great and I use it all the time. At times I want to hilight output data like grep can do with $GREP_COLORS, but without actually filtering the results. This program does just that.
OPTIONS
TODO
ENVIRONMENT
There's two environment variables that can be read and processes by cgrep:
CGREP_MATCH
CGREP_NONMATCH
The first one defines the colors and attributes given to a match, the second one decides how what not matched should look like.
cgrep makes use of Term::ExtendedColor, and can therefore use a range of color/attribute definitions:
export CGREP_MATCH=red
export CGREP_NONMATCH=white
export CGREP_MATCH=38;5;196;1 # bold red (color index 196)
export CGREP_NONMATCH=38;5;88;3 # italic darker red
EXAMPLES
# match one or more digits that's not preceeded by mp|MP, as in MP3.
beet ls artist:laleh | cgrep '(?<!(?i:mp))\d+'
REPORTING BUGS
Report bugs and/or feature requests on rt.cpan.org, the repository issue tracker or directly to [email protected]
AUTHOR
Magnus Woldrich
CPAN ID: WOLDRICH
[email protected]
[email protected] #perl
L<~/|http://japh.se>
L<git|http://github.com/trapd00r>
CONTRIBUTORS
None required yet.
COPYRIGHT
Copyright 2021- THIS APPLICATIONs "AUTHOR" and "CONTRIBUTORS" as listed above.
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.