Use -p to print matched lines
Printing the regular expression used for matching is not such a good
use-case. Printing matched lines on the other hand, will allow using rex
as an interactive regex-based text filter.
Strip \r from lines
This fixes issues with files using CRLF as line ending.
Remove sh syntax in README
Rename --print-regex to just --print
* Use passive voice where possible
* Avoid "regex" and say "input field" instead
* Other style improvements
Wrap readme to 80 columns instead of 72
Improve overall installation process
Use pflag module for option parsing
The default flag module makes long options a bit confusing by adding a
single dash before them. With pflag, long options have --option and -o
for short options.
It should be opt-in instead of opt-out.
Document default for -no-print
readme: add section about flags
Add -no-print option to prevent printing regex
Add support for STDIN
This adds the ability to read from stdin, as opposed to reading a file.
A simple example would be the following:
printf "foo\nbar\n" | rex
If text is piped from stdin *and* from a file, the file will be
printf "foo\nbar\n" | rex test.txt