yetibot / core

:expressionless: Core yetibot utilities, extracted for shared use among Yetibot and its various plugins
https://yetibot.com
Eclipse Public License 1.0
27 stars 17 forks source link

Allow options to be combined in grep #152

Open devth opened 3 years ago

devth commented 3 years ago

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.