Struct clap_verbosity_flag::Verbosity [−][src]
pub struct Verbosity { /* fields omitted */ }
Easily add a --verbose
flag to CLIs using Structopt
Examples
extern crate clap_verbosity_flag; #[macro_use] extern crate structopt; use structopt::StructOpt; use clap_verbosity_flag::Verbosity; /// Le CLI #[derive(Debug, StructOpt)] struct Cli { #[structopt(flatten)] verbose: Verbosity, }
Methods
impl Verbosity
[src]
impl Verbosity
pub fn log_level(&self) -> Level
[src]
pub fn log_level(&self) -> Level
Get the log level.
pub fn setup_env_logger(&self, own_pkg_name: &str) -> Result<(), Error>
[src]
pub fn setup_env_logger(&self, own_pkg_name: &str) -> Result<(), Error>
Initialize env_logger
and set the log level for the given package.
All other modules default to printing warnings.
Trait Implementations
impl StructOpt for Verbosity
[src]
impl StructOpt for Verbosity
fn 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) -> Self
Creates 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() -> Self
Gets 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 Verbosity
[src]
impl Debug for Verbosity
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Verbosity
[src]
impl Clone for Verbosity
fn clone(&self) -> Verbosity
[src]
fn clone(&self) -> Verbosity
Returns 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 Display for Verbosity
[src]
impl Display for Verbosity