#[non_exhaustive]pub enum Option {
Show 19 variants
AllExport,
Clobber,
CmdLine,
ErrExit,
Exec,
Glob,
HashOnDefinition,
IgnoreEof,
Interactive,
Log,
Login,
Monitor,
Notify,
PosixlyCorrect,
Stdin,
Unset,
Verbose,
Vi,
XTrace,
}Expand description
Shell option
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AllExport
Makes all variables exported when they are assigned.
Clobber
Allows overwriting and truncating an existing file with the >
redirection.
CmdLine
Executes a command string specified as a command line argument.
ErrExit
Makes the shell to exit when a command returns a non-zero exit status.
Exec
Makes the shell to actually run commands.
Glob
Enables pathname expansion.
HashOnDefinition
Performs command search for each command in a function on its definition.
IgnoreEof
Prevents the interactive shell from exiting when the user enters an end-of-file.
Interactive
Enables features for interactive use.
Log
Allows function definition commands to be recorded in the command history.
Login
Sources the profile file on startup.
Monitor
Enables job control.
Notify
Automatically reports the results of asynchronous jobs.
PosixlyCorrect
Disables most non-POSIX extensions.
Stdin
Reads commands from the standard input.
Unset
Expands unset variables to an empty string rather than erroring out.
Verbose
Echos the input before parsing and executing.
Vi
Enables vi-like command line editing.
XTrace
Prints expanded words during command execution.
Implementations§
Source§impl Option
impl Option
Sourcepub const fn is_modifiable(self) -> bool
pub const fn is_modifiable(self) -> bool
Whether this option can be modified by the set built-in.
Unmodifiable options can be set only on shell startup.
Sourcepub const fn short_name(self) -> Option<(char, State)>
pub const fn short_name(self) -> Option<(char, State)>
Returns the single-character option name.
This function returns a short name for the option and the state rendered
by the name.
The name can be converted back to Option with parse_short.
Note that the result is None for options that do not have a short
name.
Sourcepub const fn long_name(self) -> &'static str
pub const fn long_name(self) -> &'static str
Returns the option name, all in lower case without punctuations.
This function returns a string like "allexport" and "exec".
The name can be converted back to Option with parse_long.
Trait Implementations§
Source§impl EnumSetTypePrivate for Option
impl EnumSetTypePrivate for Option
Source§const CONST_HELPER_INSTANCE: __EnumSetConstHelper = __EnumSetConstHelper
const CONST_HELPER_INSTANCE: __EnumSetConstHelper = __EnumSetConstHelper
ConstHelper.Source§const ALL_BITS: Self::Repr = {transmute(0x0007ffff): <option::Option as enumset::__internal::EnumSetTypePrivate>::Repr}
const ALL_BITS: Self::Repr = {transmute(0x0007ffff): <option::Option as enumset::__internal::EnumSetTypePrivate>::Repr}
Source§const VARIANT_COUNT: u32 = 19u32
const VARIANT_COUNT: u32 = 19u32
Source§type ConstHelper = __EnumSetConstHelper
type ConstHelper = __EnumSetConstHelper
enum_set! macro among other things.Source§fn enum_into_u32(self) -> u32
fn enum_into_u32(self) -> u32
Source§unsafe fn enum_from_u32(val: u32) -> Self
unsafe fn enum_from_u32(val: u32) -> Self
Source§impl Extend<Option> for OptionSet
impl Extend<Option> for OptionSet
Source§fn extend<T: IntoIterator<Item = Option>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Option>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl FromStr for Option
Parses an option name.
impl FromStr for Option
Parses an option name.
The input string should be a canonical option name, that is, all the characters should be lowercase and there should be no punctuations or other irrelevant characters. You can canonicalize the name before parsing it.
The option name may be abbreviated as long as it is an unambiguous prefix of
a valid option name. For example, Option::from_str("clob") will return
Ok(Clobber) like Option::from_str("clobber"). If the name is ambiguous,
from_str returns Err(Ambiguous). A full option name is never considered
ambiguous. For example, "log" is not ambiguous even though it is also a
prefix of another valid option "login".
Note that new options may be added in the future, which can turn an unambiguous option name into an ambiguous one. You should use full option names for maximum compatibility.
impl Copy for Option
impl EnumSetType for Option
impl Eq for Option
impl StructuralPartialEq for Option
Auto Trait Implementations§
impl Freeze for Option
impl RefUnwindSafe for Option
impl Send for Option
impl Sync for Option
impl Unpin for Option
impl UnwindSafe for Option
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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