pub enum Shell {
Bash,
Zsh,
Fish,
}shell only.Expand description
A shell a CLI prints a script for: the set Homebrew installs completion for by default.
Every verb that takes a Shell supports every variant. A shell joins the
set only when each of those verbs has a tested form for it.
The set is closed, and the enum is deliberately not #[non_exhaustive].
A caller matches on every variant, so the compiler shows each place a
new shell needs a script. Adding a shell is therefore a breaking release.
The command-line value is the lowercase name: bash, zsh, or fish.
Variants§
Implementations§
Source§impl Shell
impl Shell
Sourcepub fn script(self, bin: &str) -> Result<Script>
Available on crate feature completion only.
pub fn script(self, bin: &str) -> Result<Script>
completion only.The registration script for bin, which the shell finds on PATH
at each TAB.
The script calls bin by name, never by the path that produced it.
A script Homebrew writes from a versioned directory then keeps working
after the next upgrade.
§Errors
Returns an error when the script clap_complete writes is not UTF-8,
which a bin that is a &str never causes.