mirror of
https://github.com/clap-rs/clap
synced 2024-12-16 07:42:32 +00:00
a91411742c
Fix #21
25 lines
517 B
Rust
25 lines
517 B
Rust
#[macro_use]
|
|
extern crate structopt;
|
|
|
|
use structopt::StructOpt;
|
|
|
|
#[derive(StructOpt, Debug)]
|
|
struct Cmdline {
|
|
#[structopt(short = "v", help = "switch on verbosity")]
|
|
verbose: bool,
|
|
#[structopt(flatten)]
|
|
daemon_opts: DaemonOpts,
|
|
}
|
|
|
|
#[derive(StructOpt, Debug)]
|
|
struct DaemonOpts {
|
|
#[structopt(short = "u", help = "daemon user")]
|
|
user: String,
|
|
#[structopt(short = "g", help = "daemon group")]
|
|
group: String,
|
|
}
|
|
|
|
fn main() {
|
|
let opt = Cmdline::from_args();
|
|
println!("{:?}", opt);
|
|
}
|