Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow options to be combined in grep #152

Open
devth opened this issue Oct 10, 2020 · 0 comments
Open

Allow options to be combined in grep #152

devth opened this issue Oct 10, 2020 · 0 comments

Comments

@devth
Copy link
Member

devth commented Oct 10, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant