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();Implementations§
source§impl ColorChoice
 
impl ColorChoice
sourcepub fn possible_values() -> impl Iterator<Item = PossibleValue>
 
pub fn possible_values() -> impl Iterator<Item = PossibleValue>
Report all possible_values
Trait Implementations§
source§impl Clone for ColorChoice
 
impl Clone for ColorChoice
source§fn clone(&self) -> ColorChoice
 
fn clone(&self) -> ColorChoice
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moresource§impl Debug for ColorChoice
 
impl Debug for ColorChoice
source§impl Default for ColorChoice
 
impl Default for ColorChoice
source§fn default() -> ColorChoice
 
fn default() -> ColorChoice
Returns the “default value” for a type. Read more
source§impl Display for ColorChoice
 
impl Display for ColorChoice
source§impl FromStr for ColorChoice
 
impl FromStr for ColorChoice
source§impl PartialEq<ColorChoice> for ColorChoice
 
impl PartialEq<ColorChoice> for ColorChoice
source§fn eq(&self, other: &ColorChoice) -> bool
 
fn eq(&self, other: &ColorChoice) -> bool
source§impl ValueEnum for ColorChoice
 
impl ValueEnum for ColorChoice
source§fn value_variants<'a>() -> &'a [ColorChoice]
 
fn value_variants<'a>() -> &'a [ColorChoice]
All possible argument values, in display order.
source§fn to_possible_value(&self) -> Option<PossibleValue>
 
fn to_possible_value(&self) -> Option<PossibleValue>
The canonical argument value. Read more