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

Initial autocompletion #3412

Merged
merged 2 commits into from
Oct 6, 2017
Merged

Initial autocompletion #3412

merged 2 commits into from
Oct 6, 2017

Conversation

brianshumate
Copy link
Member

Initial autocomplete spike!

I vendored latest CLI and verified consul -autocomplete-install and basic sub-command completion was occurring for me in zsh 🎉

Had to add Name: as well because Autocomplete errors without it:

./consul
Error executing CLI: internal error: CLI.Name must be specified for autocomplete to work

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?!

@slackpad
Copy link
Contributor

Hey @brianshumate this looks good! Can you please add a note about this in the docs?

@brianshumate
Copy link
Member Author

Hey James,

Thanks and sure thing, I'll add a note shortly and PR that as well!

@brianshumate
Copy link
Member Author

Okay added an Autocompletion section to the Commands docs!

@slackpad
Copy link
Contributor

@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
Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

@preetapan preetapan Oct 6, 2017

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  

Copy link
Contributor

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

@preetapan preetapan merged commit 3703b05 into master Oct 6, 2017
@preetapan preetapan deleted the jbs-autocomplete branch October 6, 2017 20:46
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.

3 participants