[−][src]Enum clap::ValueHint
Provides hints about argument types for shell command completion.
See the clap_generate
crate for completion script generation.
Overview of which hints are supported by which shell:
Hint | zsh | fish1 |
---|---|---|
AnyPath | Yes | Yes |
FilePath | Yes | Yes |
DirPath | Yes | Yes |
ExecutablePath | Yes | Partial |
CommandName | Yes | Yes |
CommandString | Yes | Partial |
CommandWithArguments | Yes | |
Username | Yes | Yes |
Hostname | Yes | Yes |
Url | Yes | |
EmailAddress | Yes |
fish completions currently only support named arguments (e.g. -o or --opt), not positional arguments. ↩
Variants
Default value if hint is not specified. Follows shell default behavior, which is usually auto-completing filenames.
None of the hints below apply. Disables shell completion for this argument.
Any existing path.
Path to a file.
Path to a directory.
Path to an executable file.
Name of a command, without arguments. May be relative to PATH, or full path to executable.
A single string containing a command and its arguments.
Capture the remaining arguments as a command name and arguments for that command. This is
common when writing shell wrappers that execute anther command, for example sudo
or env
.
This hint is special, the argument must be a positional argument and have
.multiple(true)
and App must use AppSettings::TrailingVarArg
. The result is that the
command line my_app ls -la /
will be parsed as ["ls", "-la", "/"]
and clap won't try to
parse the -la
argument itself.
Name of a local operating system user.
Host name of a computer.
Shells usually parse /etc/hosts
and .ssh/known_hosts
to complete hostnames.
Complete web address.
Email address.
Trait Implementations
impl Clone for ValueHint
[src]
impl Copy for ValueHint
[src]
impl Debug for ValueHint
[src]
impl Default for ValueHint
[src]
impl FromStr for ValueHint
[src]
type Err = String
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl PartialEq<ValueHint> for ValueHint
[src]
impl StructuralPartialEq for ValueHint
[src]
Auto Trait Implementations
impl RefUnwindSafe for ValueHint
impl Send for ValueHint
impl Sync for ValueHint
impl Unpin for ValueHint
impl UnwindSafe for ValueHint
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,