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.
30 lines
485 B
30 lines
485 B
//! How to use flattening.
|
|
|
|
use structopt::StructOpt;
|
|
|
|
#[derive(StructOpt, Debug)]
|
|
struct Cmdline {
|
|
/// switch verbosity on
|
|
#[structopt(short)]
|
|
verbose: bool,
|
|
|
|
#[structopt(flatten)]
|
|
daemon_opts: DaemonOpts,
|
|
}
|
|
|
|
#[derive(StructOpt, Debug)]
|
|
struct DaemonOpts {
|
|
/// daemon user
|
|
#[structopt(short)]
|
|
user: String,
|
|
|
|
/// daemon group
|
|
#[structopt(short)]
|
|
group: String,
|
|
}
|
|
|
|
fn main() {
|
|
let opt = Cmdline::from_args();
|
|
println!("{:?}", opt);
|
|
}
|