summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
blob: 0000644b464db8de4abea60a755b1419670358d8 (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
36
37
38
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,
    },
    Inspect,
    Config {
        #[structopt(subcommand)]
        command: ConfigCommand,
    },
}

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