rover icon indicating copy to clipboard operation
rover copied to clipboard

Shell Completions!

Open EverlastingBugstopper opened this issue 4 years ago • 1 comments

I'd love to be able to let folks type rover, or rover graph and then press <tab> and see a list of commands! @lrlna pointed out that if they type --profile we could to tab completions for any of the profiles that they have on their machine which would be super cool.

The author of clap has recently released an article about generating shell completions in this blog post. In the post he mentions that there are two ways you can generate shell completions:

  1. At compile time
  • This approach would allow us to generate shell completions in build.rs, bundle, and source them with both our curl installer and our npm postinstall script
  1. At runtime
  • This approach would require users to run rover completions generate > ~/.rover/completions.sh && source ~/.rover/completions.sh on their own

I'd love to get Rover to the point where you install it, and completions just work. I think this would add a lot of value to all of Rover's users 😄

EverlastingBugstopper avatar Apr 08 '21 16:04 EverlastingBugstopper

Note that clap_complete now exists, which makes it pretty easy to add a subcommand to rover so that people can add source "$(rover completions --shell bash)" or whatever to their dotfiles.

glasser avatar Dec 16 '24 23:12 glasser