fishi0x01 / vsh

vsh - HashiCorp Vault interactive shell and cli tool
MIT License
284 stars 12 forks source link

allow limiting scope of grep to keys or values #66

Closed mattlqx closed 3 years ago

mattlqx commented 3 years ago

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.