summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index e106de7..0a883af 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1,5 +1,9 @@
1use crate::config::Config;
2
1use structopt::StructOpt; 3use structopt::StructOpt;
2 4
5use std::path::PathBuf;
6
3#[derive(Debug, Clone, StructOpt)] 7#[derive(Debug, Clone, StructOpt)]
4pub(crate) struct Cli { 8pub(crate) struct Cli {
5 #[structopt(long, short, parse(from_occurrences))] 9 #[structopt(long, short, parse(from_occurrences))]
@@ -8,11 +12,27 @@ pub(crate) struct Cli {
8 #[structopt(long, number_of_values = 1, parse(try_from_str = shell_words::split))] 12 #[structopt(long, number_of_values = 1, parse(try_from_str = shell_words::split))]
9 pub(crate) extra_arg: Vec<Vec<String>>, 13 pub(crate) extra_arg: Vec<Vec<String>>,
10 14
15 #[structopt(long, short = "C", default_value = ".")]
16 pub(crate) directory: PathBuf,
17
11 #[structopt(subcommand)] 18 #[structopt(subcommand)]
12 pub(crate) command: Command, 19 pub(crate) command: Command,
20
21 #[structopt(flatten)]
22 pub(crate) common_options: Config,
13} 23}
14 24
15#[derive(Debug, Clone, StructOpt)] 25#[derive(Debug, Clone, StructOpt)]
16pub(crate) enum Command { 26pub(crate) enum Command {
17 Generate { file: String }, 27 Generate { file: String },
28 Config {
29 #[structopt(subcommand)]
30 command: ConfigCommand,
31 }
32}
33
34#[derive(Debug, Clone, StructOpt)]
35pub(crate) enum ConfigCommand {
36 Default,
37 Show,
18} 38}