Enum clap::ColorChoice
source · [−]pub enum ColorChoice {
Auto,
Always,
Never,
}
Expand description
Represents the color preferences for program output
Variants
Auto
Enables colored output only when the output is going to a terminal or TTY.
NOTE: This is the default behavior of clap
.
Platform Specific
This setting only applies to Unix, Linux, and macOS (i.e. non-Windows platforms).
Examples
Command::new("myprog")
.color(ColorChoice::Auto)
.get_matches();
Always
Enables colored output regardless of whether or not the output is going to a terminal/TTY.
Platform Specific
This setting only applies to Unix, Linux, and macOS (i.e. non-Windows platforms).
Examples
Command::new("myprog")
.color(ColorChoice::Always)
.get_matches();
Never
Disables colored output no matter if the output is going to a terminal/TTY, or not.
Platform Specific
This setting only applies to Unix, Linux, and macOS (i.e. non-Windows platforms)
Examples
Command::new("myprog")
.color(ColorChoice::Never)
.get_matches();
Trait Implementations
sourceimpl Clone for ColorChoice
impl Clone for ColorChoice
sourcefn clone(&self) -> ColorChoice
fn clone(&self) -> ColorChoice
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ColorChoice
impl Debug for ColorChoice
sourceimpl Default for ColorChoice
impl Default for ColorChoice
sourceimpl PartialEq<ColorChoice> for ColorChoice
impl PartialEq<ColorChoice> for ColorChoice
sourcefn eq(&self, other: &ColorChoice) -> bool
fn eq(&self, other: &ColorChoice) -> bool
sourceimpl ValueEnum for ColorChoice
impl ValueEnum for ColorChoice
sourcefn value_variants<'a>() -> &'a [Self]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
fn value_variants<'a>() -> &'a [Self]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
All possible argument values, in display order.
sourcefn to_possible_value(&self) -> Option<PossibleValue>
fn to_possible_value(&self) -> Option<PossibleValue>
The canonical argument value. Read more
impl Copy for ColorChoice
impl Eq for ColorChoice
impl StructuralEq for ColorChoice
impl StructuralPartialEq for ColorChoice
Auto Trait Implementations
impl RefUnwindSafe for ColorChoice
impl Send for ColorChoice
impl Sync for ColorChoice
impl Unpin for ColorChoice
impl UnwindSafe for ColorChoice
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more