2018-04-12 09:27:57 +00:00
|
|
|
#[macro_use]
|
2018-07-02 18:45:17 +00:00
|
|
|
extern crate clap;
|
2018-04-12 09:27:57 +00:00
|
|
|
|
2018-07-02 18:45:17 +00:00
|
|
|
use clap::Clap;
|
2018-04-12 09:27:57 +00:00
|
|
|
|
2018-07-02 18:45:17 +00:00
|
|
|
#[derive(Clap, Debug)]
|
2018-04-12 09:27:57 +00:00
|
|
|
struct Cmdline {
|
2018-07-02 18:45:17 +00:00
|
|
|
#[clap(short = "v", help = "switch on verbosity")]
|
2018-04-12 09:27:57 +00:00
|
|
|
verbose: bool,
|
2018-07-02 18:45:17 +00:00
|
|
|
#[clap(flatten)]
|
2018-04-12 09:27:57 +00:00
|
|
|
daemon_opts: DaemonOpts,
|
|
|
|
}
|
|
|
|
|
2018-07-02 18:45:17 +00:00
|
|
|
#[derive(Clap, Debug)]
|
2018-04-12 09:27:57 +00:00
|
|
|
struct DaemonOpts {
|
2018-07-02 18:45:17 +00:00
|
|
|
#[clap(short = "u", help = "daemon user")]
|
2018-04-12 09:27:57 +00:00
|
|
|
user: String,
|
2018-07-02 18:45:17 +00:00
|
|
|
#[clap(short = "g", help = "daemon group")]
|
2018-04-12 09:27:57 +00:00
|
|
|
group: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2018-07-02 18:45:17 +00:00
|
|
|
let opt = Cmdline::parse();
|
2018-04-12 09:27:57 +00:00
|
|
|
println!("{:?}", opt);
|
|
|
|
}
|