aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/input
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-05-14 11:57:57 +0200
committerGitHub <noreply@github.com>2021-05-14 11:57:57 +0200
commit26cd36720b8351cc3490c02da1d32cf9770e56ff (patch)
treebd4d2b39c166a41c780da14244cf1552158b9ad9 /src/common/input
parentchore(version): bump development version (diff)
parentAdd `check` flag to the setup subcommand (diff)
downloadsl0ppij-26cd36720b8351cc3490c02da1d32cf9770e56ff.tar.gz
sl0ppij-26cd36720b8351cc3490c02da1d32cf9770e56ff.tar.xz
sl0ppij-26cd36720b8351cc3490c02da1d32cf9770e56ff.zip
Merge pull request #503 from a-kenji/check-setup
Add `check` flag to 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());
}