Add ring completions for bash, zsh and fish - #207
Merged
Conversation
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.
ring completions <bash|zsh|fish>prints a shell completion script on stdout, so<TAB>completes commands, subcommands and flags.build_cli()), so completions can never drift from the real commands: a new subcommand is completable with no extra work.completionsis dispatched before the config is loaded, so generating a script works on a machine that has never runring init.clap_completealso knows elvish and powershell; accepting values the docs don't describe would put--helpand the reference out of sync.Verified by loading the generated scripts into real shells, not just by generating them: the bash examples above are actual
COMPREPLYoutput, and the zsh script loads viafpath+compinit. Syntax checked withbash -n/zsh -n. Fish is generated and covered by unit tests, but could not be loaded here (fish is not installed on the dev machine).The second commit fixes three pre-existing clippy errors (
apply.rs,container.rs, untouched since March) that-D warningsturns into failures on a newer clippy. They were blocking the pre-push hook and are unrelated to this feature.