Merged
Conversation
Contributor
|
This is awesome 👍 My preference would be to stick with just |
This commit adds two sections to the command line options to enable building of Shell Completion Scripts to `stdout`. This allows these scripts to be redirected to a file, effectively allowing the user to install these scripts at the location of their choosing. The arguments only accept the values `zsh`, `fish` and `bash`, which clap guards against. To use these scripts one must do one of the following *Note:* The commands `rustup completions <SHELL>` and `rustup self --completions <SHELL>` are synonyms for each other, and do the exact same thing. ``` $ rustup completions bash > /path/to/completions/dir/rustup.bash-completion ``` ``` $ rustup completions fish > ~/.config/fish/completions/rustup.fish ``` ``` $ mkdir ~/.zfunc $ rustup completions zsh > ~/.zfunc/_rustup $ echo "fpath+=~/.zfunc\ncominit" >> ~/.zshrc $ exec zsh ``` Relates to rust-lang#278
Contributor
Author
|
That's a simple change - just let me know if you need me to change it, or any other aspects and I'd be happy to do so 😉 |
Contributor
Contributor
Author
|
I've removed the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds a command line option to generate completion scripts, as well as updates
clapto 2.16.0 which adds ZSH completion support.Here's a gif of the new ZSH support and the new
rustup completionssubcommand backing it.Specifically this commit adds
Finally, this PR adds some additional help documentation on the
completionscommand, and changes theREADME.mdslightly to reflect the new additions.Some notes about the ZSH script generated by
clap, it supports, subcommands, flags, args, and options. The options also automatically list theirpossible_values, and will automatically not list any arguments theyconflictwith. This may not be too applicable torustupsince I don't think many of those options are used, but it's good to note for future reference.Also, positional arguments, such as
toolchainin a few of the subcommands is changed to uppercase ASCII byclapin order to differentiate.Edit: removed verbiage about
--completions