Enum clap::ValueHint [−][src]
pub enum ValueHint {
Show 13 variants
Unknown,
Other,
AnyPath,
FilePath,
DirPath,
ExecutablePath,
CommandName,
CommandString,
CommandWithArguments,
Username,
Hostname,
Url,
EmailAddress,
}
Expand description
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_values(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
Auto Trait Implementations
impl RefUnwindSafe for ValueHint
impl UnwindSafe for ValueHint
Blanket Implementations
Mutably borrows from an owned value. Read more