pub struct Verbosity { /* private fields */ }
Expand description
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,
}
Implementations
Trait Implementations
sourceimpl StructOpt for Verbosity
impl StructOpt for Verbosity
sourcefn from_clap(matches: &ArgMatches<'_>) -> Verbosity
fn from_clap(matches: &ArgMatches<'_>) -> Verbosity
Creates the struct from
clap::ArgMatches
. It cannot fail
with a parameter generated by clap
by construction. Read morefn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
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) -> Selfwhere
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter<I>(iter: I) -> Selfwhere
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + 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 morefn from_iter_safe<I>(iter: I) -> Result<Self, Error>where
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error>where
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
Gets the struct from any iterator such as a
Vec
of your making. Read moreAuto Trait Implementations
impl RefUnwindSafe for Verbosity
impl Send for Verbosity
impl Sync for Verbosity
impl Unpin for Verbosity
impl UnwindSafe for Verbosity
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more