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

Added --recurse and --trim to cli kv_get #58

Merged
merged 2 commits into from
Jul 21, 2015

Conversation

MWers
Copy link
Contributor

@MWers MWers commented Jul 20, 2015

Added --recurse and --trim to cli kv_get as per issue #56.

I had trouble getting argparse to allow 0/1 args for --trim without conflicting with the key. If there's an easy way to do this that I'm overlooking, please let me know.

Here are a few simple examples using --recurse and --trim:

$ consulate kv get --recurse test
test/recursive/KEY_1    one
test/recursive/KEY_2    two
test/recursive/KEY_3    three
$ consulate kv get --recurse --trim 0 test
test/recursive/KEY_1    one
test/recursive/KEY_2    two
test/recursive/KEY_3    three
$ consulate kv get --recurse --trim 1 test
recursive/KEY_1 one
recursive/KEY_2 two
recursive/KEY_3 three
$ consulate kv get --recurse --trim 2 test
KEY_1   one
KEY_2   two
KEY_3   three
$ consulate kv get --recurse --trim 3 test
KEY_1   one
KEY_2   two
KEY_3   three
$ consulate kv get --recurse --trim 99999 test
KEY_1   one
KEY_2   two
KEY_3   three

@gmr
Copy link
Owner

gmr commented Jul 21, 2015

Looks good, I'll play with argparse and let you know what find.

gmr added a commit that referenced this pull request Jul 21, 2015
Added --recurse and --trim to cli kv_get
@gmr gmr merged commit 7f4827b into gmr:master Jul 21, 2015
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