]> git.proxmox.com Git - rustc.git/blame - vendor/structopt/examples/negative_flag.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / vendor / structopt / examples / negative_flag.rs
CommitLineData
f20569fa
XL
1//! How to add `no-thing` flag which is `true` by default and
2//! `false` if passed.
3
4use structopt::StructOpt;
5
6#[derive(Debug, StructOpt)]
7struct Opt {
8 #[structopt(long = "no-verbose", parse(from_flag = std::ops::Not::not))]
9 verbose: bool,
10}
11
12fn main() {
13 let cmd = Opt::from_args();
14 println!("{:#?}", cmd);
15}