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 limiting scope of grep to keys or values #66

Merged
merged 1 commit into from
Jan 29, 2021
Merged

allow limiting scope of grep to keys or values #66

merged 1 commit into from
Jan 29, 2021

Conversation

mattlqx
Copy link
Collaborator

@mattlqx mattlqx commented Jan 28, 2021

Previously, keys and values are both searched with no option to limit scope to one or the other. This pull adds two flags to grep, one for keys (-k/--keys) and one for values (-v/--values). If either of these are specified, only that part will be searched. Default behavior is preserved to search both keys and values with neither of these flags present.

This pull also makes a small change to surface errors returned by Commands as UserErrors. Previously, these errors were not able to be seen and only a usage was printed. As commands become more complex, this will help direct users to the problem.

Previously, keys and values are both searched with no option to limit scope to one or the other. This pull adds two flags to grep, one for keys (`-k`/`--keys`) and one for values (`-v`/`--values`). If either of these are specified, only that part will be searched. Default behavior is preserved to search both keys and values with neither of these flags present.

This pull also makes a small change to surface errors returned by Commands as UserErrors. Previously, these errors were not able to be seen and only a usage was printed. As commands become more complex, this will help direct users to the problem.
Copy link
Owner

@fishi0x01 fishi0x01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks again @mattlqx 🙇

( reference to #59 )

@fishi0x01 fishi0x01 merged commit 9e71c8f into fishi0x01:master Jan 29, 2021
@mattlqx mattlqx deleted the kv-selector branch January 29, 2021 17:41
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

Successfully merging this pull request may close these issues.

2 participants