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
.
§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.
§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.
§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§impl Display for ColorChoice
impl Display for ColorChoice
Source§impl FromStr for ColorChoice
impl FromStr for ColorChoice
Source§impl PartialEq for ColorChoice
impl PartialEq for ColorChoice
Source§impl ValueEnum for ColorChoice
impl ValueEnum for ColorChoice
impl Copy for ColorChoice
impl Eq for ColorChoice
impl StructuralPartialEq for ColorChoice
Auto Trait Implementations§
impl Freeze for ColorChoice
impl RefUnwindSafe for ColorChoice
impl Send for ColorChoice
impl Sync for ColorChoice
impl Unpin for ColorChoice
impl UnwindSafe for ColorChoice
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
Mutably borrows from an owned value. Read more