aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/input
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-05-12 22:37:17 +0200
committera-kenji <aks.kenji@protonmail.com>2021-05-14 11:45:19 +0200
commitd667e5ed81fbaef003fe9f01a4bcdbffe5dd0928 (patch)
treea7389c2f167a743ef568db6cae4139ebf5b02e38 /src/common/input
parentMerge pull request #465 from a-kenji/set-data-dir (diff)
downloadsl0ppij-d667e5ed81fbaef003fe9f01a4bcdbffe5dd0928.tar.gz
sl0ppij-d667e5ed81fbaef003fe9f01a4bcdbffe5dd0928.tar.xz
sl0ppij-d667e5ed81fbaef003fe9f01a4bcdbffe5dd0928.zip
Add `check` flag to the setup subcommand
* The check option communicates default and config options to the user as well as optional compile time features * Move generate-completion from a subcommand to a flag in the setup subcommand
Diffstat (limited to 'src/common/input')
-rw-r--r--src/common/input/config.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/common/input/config.rs b/src/common/input/config.rs
index 5f2656f3..3dffe71c 100644
--- a/src/common/input/config.rs
+++ b/src/common/input/config.rs
@@ -60,8 +60,8 @@ impl TryFrom<&CliArgs> for Config {
return Config::new(&path);
}
- if let Some(ConfigCli::Setup { clean, .. }) = opts.option {
- if clean {
+ if let Some(ConfigCli::Setup(setup)) = opts.option.clone() {
+ if setup.clean {
return Config::from_default_assets();
}
}
@@ -177,11 +177,12 @@ mod config_test {
#[test]
fn try_from_cli_args_with_option_clean() {
+ use crate::common::setup::Setup;
let mut opts = CliArgs::default();
- opts.option = Some(ConfigCli::Setup {
+ opts.option = Some(ConfigCli::Setup(Setup {
clean: true,
- dump_config: false,
- });
+ ..Setup::default()
+ }));
let result = Config::try_from(&opts);
assert!(result.is_ok());
}