pub enum Shell {
Bash,
Zsh,
Fish,
PowerShell,
}Expand description
A shell that completions can be generated for.
Variants§
Bash
GNU Bash, via complete -F.
Zsh
Z shell, via an autoloaded #compdef function.
Fish
fish, via complete -c.
PowerShell
PowerShell, via Register-ArgumentCompleter -Native.
Implementations§
Source§impl Shell
impl Shell
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The lowercase name used on the command line and in file paths.
Sourcepub fn file_name(self, bin: &str) -> String
pub fn file_name(self, bin: &str) -> String
The filename each shell expects to find in its completions directory.
These are not cosmetic. Bash looks for a file named exactly after
the command, zsh requires the leading underscore to autoload the
function, and fish requires the .fish extension.
§Examples
use ssg::cmd::completions::Shell;
assert_eq!(Shell::Bash.file_name("ssg"), "ssg");
assert_eq!(Shell::Zsh.file_name("ssg"), "_ssg");
assert_eq!(Shell::Fish.file_name("ssg"), "ssg.fish");Trait Implementations§
impl Copy for Shell
impl Eq for Shell
Source§impl Ord for Shell
impl Ord for Shell
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Shell
impl PartialOrd for Shell
impl StructuralPartialEq for Shell
Auto Trait Implementations§
impl Freeze for Shell
impl RefUnwindSafe for Shell
impl Send for Shell
impl Sync for Shell
impl Unpin for Shell
impl UnsafeUnpin for Shell
impl UnwindSafe for Shell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more