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

Enable the verbose output No multiple occurrences are supported

Trait Implementations

impl StructOpt for SimpleVerbose
[src]

Returns the corresponding clap::App.

Creates the struct from clap::ArgMatches. It cannot fail with a parameter generated by clap by construction. Read more

Gets the struct from the command line arguments. Print the error message and quit the program in case of failure. Read more

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

Gets the struct from any iterator such as a Vec of your making. Read more

impl Debug for SimpleVerbose
[src]

Formats the value using the given formatter. Read more

impl Clone for SimpleVerbose
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Display for SimpleVerbose
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations