summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
blob: dddff76084f661c3358363a21ca97ecf01942f17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::path::PathBuf;

use structopt::StructOpt;
use failure::Error;

#[derive(Debug, StructOpt)]
#[structopt(name = "example", about = "An example of StructOpt usage.")]
pub struct CLI {
    #[structopt(short, long)]
    debug: bool,

    #[structopt(short, long)]
    trace: bool,

    #[structopt(parse(from_os_str))]
    configfile: Option<PathBuf>,
}

pub fn cli() -> Result<CLI, Error> {
    Ok(CLI::from_args())
}