Struct structopt_flags::QuietVerbose [−][src]
pub struct QuietVerbose { /* fields omitted */ }This struct implements the --verbose and the --quiet cli options
By default, the log level is set to warning.
Multiple occurrences of -v, will increase the verbosity level up to 3.
The flag -q is used to decrease verbosity.
Using it twice, will silent the log.
extern crate structopt_flags; #[macro_use] extern crate structopt; use structopt::StructOpt; use structopt_flags::LogLevel; // to access get_log_level #[derive(Debug, StructOpt)] #[structopt(name = "verbose", about = "An example using verbose flag")] struct Opt { #[structopt(flatten)] verbose: structopt_flags::Verbose, } fn main() { let opt = Opt::from_args(); let filter_level = opt.verbose.get_level_filter(); // set log level }
Trait Implementations
impl StructOpt for QuietVerbose[src]
impl StructOpt for QuietVerbosefn clap<'a, 'b>() -> App<'a, 'b>[src]
fn clap<'a, 'b>() -> App<'a, 'b>Returns the corresponding clap::App.
fn from_clap(matches: &ArgMatches) -> Self[src]
fn from_clap(matches: &ArgMatches) -> SelfCreates the struct from clap::ArgMatches. It cannot fail with a parameter generated by clap by construction. Read more
fn from_args() -> Self[src]
fn from_args() -> SelfGets the struct from the command line arguments. Print the error message and quit the program in case of failure. Read more
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone, [src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone, Gets the struct from any iterator such as a Vec of your making. Print the error message and quit the program in case of failure. Read more
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone, [src]
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone, Gets the struct from any iterator such as a Vec of your making. Read more
impl Debug for QuietVerbose[src]
impl Debug for QuietVerbosefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for QuietVerbose[src]
impl Clone for QuietVerbosefn clone(&self) -> QuietVerbose[src]
fn clone(&self) -> QuietVerboseReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl LogLevel for QuietVerbose[src]
impl LogLevel for QuietVerbosefn get_level_filter(&self) -> LevelFilter[src]
fn get_level_filter(&self) -> LevelFilterReturn the level filter. Read more
fn get_log_level(&self) -> Option<Level>[src]
fn get_log_level(&self) -> Option<Level>Return the log level. Read more
impl Display for QuietVerbose[src]
impl Display for QuietVerboseAuto Trait Implementations
impl Send for QuietVerbose
impl Send for QuietVerboseimpl Sync for QuietVerbose
impl Sync for QuietVerbose