core icon indicating copy to clipboard operation
core copied to clipboard

Allow options to be combined in grep

Open devth opened this issue 5 years ago • 0 comments

Currently -v and -C are separate commands:

!hep grep
grep <pattern> <list> # filters the items in <list> by <pattern>
grep -C <n> <pattern> <list> # filter items in <list> by <pattern> and include <n> items before and after each matched item
grep -v <pattern> <list> # filter items in <list> not matching <pattern>

But we should be able to combine flags in a single command, more like:

grep [-C n] [-v] <pattern> <list>

See here for an example of cli opts parsing.

devth avatar Oct 10 '20 16:10 devth