App::highlight - simple grep-like highlighter app
highlight is similar to grep, except that instead of removing non-matched lines it simply highlights words or lines which are matched.
% cat words.txt foo bar baz qux quux corge % cat words.txt | grep ba bar baz % cat words.txt | highlight ba foo >>ba<<r >>ba<<z qux quux corge
If you give multiple match parameters highlight will highlight each of them in a different color.
% cat words.txt | highlight ba qu foo >>ba<<r >>ba<<z [[qu]]x [[qu]]ux corge
Note that brackets are not used to highlight the words, Term::ANSIColor terminal highlighting is used.
This allows you to specify a regular expression instead of a simple string.
% cat words.txt | highlight --no-escape '[abcde]+' foo >>ba<<r >>ba<<z qux quux >>c<<org>>e<<
This makes highlight always highlight full lines of input, even when the full line is not matched.
% cat words.txt | highlight --full-line u foo bar baz >>qux<< >>quux<< corge
Note this is similar to '--no-escape "^.*match.*$"' but probably much more efficient.
Rather than cycling through multiple colors, this makes highlight always use the same color for all highlights.
% cat words.txt | highlight --one-color ba qu foo >>ba<<r >>ba<<z >>qu<<x >>qu<<ux corge
Copyright (C) 2010 Alex Balhatchet
Alex Balhatchet (kaoru@slackwise.net)
To install App::highlight, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::highlight
CPAN shell
perl -MCPAN -e shell install App::highlight
For more information on module installation, please visit the detailed CPAN module installation guide.