Struct structopt_flags::Verbose [−][src]
pub struct Verbose { /* fields omitted */ }This struct provides the --verbose cli option
By default, the log level is set to error. Multiple occurrences, will increase the verbosity level up to 4.
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 Verbose[src]
impl StructOpt for Verbosefn 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 Verbose[src]
impl Debug for Verbosefn 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 Verbose[src]
impl Clone for Verbosefn clone(&self) -> Verbose[src]
fn clone(&self) -> VerboseReturns 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 Verbose[src]
impl LogLevel for Verbosefn 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 Verbose[src]
impl Display for Verbose