From 304d9f220cc208dd78fce11b703354ecd8d2168c Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 15 Nov 2019 18:14:07 +0100 Subject: add basic config file, use codemap_diagnostic for main errors --- src/cli.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/cli.rs') 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 @@ +use crate::config::Config; + use structopt::StructOpt; +use std::path::PathBuf; + #[derive(Debug, Clone, StructOpt)] pub(crate) struct Cli { #[structopt(long, short, parse(from_occurrences))] @@ -8,11 +12,27 @@ pub(crate) struct Cli { #[structopt(long, number_of_values = 1, parse(try_from_str = shell_words::split))] pub(crate) extra_arg: Vec>, + #[structopt(long, short = "C", default_value = ".")] + pub(crate) directory: PathBuf, + #[structopt(subcommand)] pub(crate) command: Command, + + #[structopt(flatten)] + pub(crate) common_options: Config, } #[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, } -- cgit v1.2.3