Struct structopt_flags::SimpleVerbose [−][src]
pub struct SimpleVerbose { pub verbose: bool, }
This struct implements the --verbose
cli option as a boolean flag
By default, the log level is set to warning.
Multiple occurrences of -v
are not supported
extern crate structopt_flags; #[macro_use] extern crate structopt; use structopt::StructOpt; #[derive(Debug, StructOpt)] #[structopt(name = "verbose", about = "An example using verbose flag")] struct Opt { #[structopt(flatten)] verbose: structopt_flags::SimpleVerbose, } fn main() { let opt = Opt::from_args(); if opt.verbose.verbose { println!("Verbose output enabled"); } else { println!("No verbose output"); } }
Fields
verbose: bool
Enable the verbose output No multiple occurrences are supported
Trait Implementations
impl StructOpt for SimpleVerbose
[src]
impl StructOpt for SimpleVerbose
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 SimpleVerbose
[src]
impl Debug for SimpleVerbose
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 SimpleVerbose
[src]
impl Clone for SimpleVerbose
fn clone(&self) -> SimpleVerbose
[src]
fn clone(&self) -> SimpleVerbose
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 SimpleVerbose
[src]
impl Display for SimpleVerbose
Auto Trait Implementations
impl Send for SimpleVerbose
impl Send for SimpleVerbose
impl Sync for SimpleVerbose
impl Sync for SimpleVerbose