[−][src]Struct codespan_reporting::term::ColorArg
A command line argument that configures the coloring of the output.
This can be used with command line argument parsers like clap
or structopt
.
Example
use codespan_reporting::term::termcolor::StandardStream; use codespan_reporting::term::ColorArg; use structopt::StructOpt; #[derive(Debug, StructOpt)] #[structopt(name = "groovey-app")] pub struct Opts { /// Configure coloring of output #[structopt( long = "color", default_value = "auto", possible_values = ColorArg::VARIANTS, case_insensitive = true, )] pub color: ColorArg, } let opts = Opts::from_args(); let writer = StandardStream::stderr(opts.color.into());
Implementations
impl ColorArg
[src][−]
pub const VARIANTS: &'static [&'static str]
[src][−][−]
Allowed values the argument.
This is useful for generating documentation via clap
or structopt
's
possible_values
configuration.
Trait Implementations
impl Clone for ColorArg
[src][+]
impl Copy for ColorArg
[src]
impl Debug for ColorArg
[src][+]
impl Eq for ColorArg
[src]
impl FromStr for ColorArg
[src][+]
impl Into<ColorChoice> for ColorArg
[src][+]
impl PartialEq<ColorArg> for ColorArg
[src][+]
impl StructuralEq for ColorArg
[src]
impl StructuralPartialEq for ColorArg
[src]
Auto Trait Implementations
impl RefUnwindSafe for ColorArg
impl Send for ColorArg
impl Sync for ColorArg
impl Unpin for ColorArg
impl UnwindSafe for ColorArg
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,