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
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 PartialEq for ColorChoice
impl PartialEq 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.