summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
blob: ff257921f66684fa2f65cd71468e9336db7f5acb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use crate::config::ProvidedConfig;

use structopt::StructOpt;

use std::path::PathBuf;

#[derive(Debug, Clone, StructOpt)]
pub(crate) struct Cli {
    #[structopt(long, short, parse(from_occurrences))]
    pub(crate) verbosity: u8,

    #[structopt(long, short = "C", default_value = ".")]
    pub(crate) directory: PathBuf,

    #[structopt(subcommand)]
    pub(crate) command: Command,

    #[structopt(flatten)]
    pub(crate) common_options: ProvidedConfig,
}

#[derive(Debug, Clone, StructOpt)]
pub(crate) enum Command {
    Generate { file: String },
    Config {
        #[structopt(subcommand)]
        command: ConfigCommand,
    }
}

#[derive(Debug, Clone, StructOpt)]
pub(crate) enum ConfigCommand {
    Default,
    Show,
}