mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-24 20:33:23 +00:00
16 lines
327 B
Rust
16 lines
327 B
Rust
//! 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);
|
|
}
|