summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
blob: 815c06589beb248824aea660c6aef0eb8187c27b (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 anyhow::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())
}