-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Initial autocompletion #3412
Initial autocompletion #3412
Conversation
Hey @brianshumate this looks good! Can you please add a note about this in the docs? |
Hey James, Thanks and sure thing, I'll add a note shortly and PR that as well! |
Okay added an Autocompletion section to the Commands docs! |
@brianshumate sorry I didn't get back to this. Want to do a quick rebase and I think we will be good here. |
event exec | ||
|
||
$ consul r | ||
raft reload rtt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raft
is actually a subcommand of operator
which looks like a limitation of the autocomplete library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I noticed that it doesn't do sub-sub commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this out just now and it worked on sub subcommands too, this is pretty cool.
preetha@preetha-work ~/go/src/github.com/hashicorp/consul-oss (jbs-autocomplete) $consul r
reload rtt
preetha@preetha-work ~/go/src/github.com/hashicorp/consul-oss (jbs-autocomplete) $consul r
reload rtt
preetha@preetha-work ~/go/src/github.com/hashicorp/consul-oss (jbs-autocomplete) $consul operator
autopilot raft
preetha@preetha-work ~/go/src/github.com/hashicorp/consul-oss (jbs-autocomplete) $consul operator raft
list-peers remove-peer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the documentation and then merge this. this is ready to go
fc03d51
to
84ee8b8
Compare
Initial autocomplete spike!
autocompletion feature from mitchellh/cli
I vendored latest CLI and verified
consul -autocomplete-install
and basic sub-command completion was occurring for me inzsh
🎉Had to add Name: as well because Autocomplete errors without it:
As I understand it, there needs to be additional work done for completion on specific CLI flags and such to make things more complete / even fancier. 😄 but perhaps this is a good start?!