You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
327 B
16 lines
327 B
7 months ago
|
//! How to add `no-thing` flag which is `true` by default and
|
||
|
//! `false` if passed.
|
||
|
|
||
|
use structopt::StructOpt;
|
||
|
|
||
|
#[derive(Debug, StructOpt)]
|
||
|
struct Opt {
|
||
|
#[structopt(long = "no-verbose", parse(from_flag = std::ops::Not::not))]
|
||
|
verbose: bool,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let cmd = Opt::from_args();
|
||
|
println!("{:#?}", cmd);
|
||
|
}
|