Minor fixes (#2038)

Fixes a couple of low hanging fruits.

- Fixes #2037 
- `validators-dir` and `secrets-dir` flags don't really need to depend upon each other
- Fixes #2006 and Fixes #1995
This commit is contained in:
Pawan Dhananjay
2020-12-03 01:10:28 +00:00
parent d8cda2d86e
commit 482695142a
7 changed files with 29 additions and 21 deletions

View File

@@ -37,7 +37,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
)
.takes_value(true)
.conflicts_with("datadir")
.requires("secrets-dir")
)
.arg(
Arg::with_name("secrets-dir")
@@ -51,7 +50,6 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
)
.takes_value(true)
.conflicts_with("datadir")
.requires("validators-dir"),
)
.arg(
Arg::with_name("delete-lockfiles")

View File

@@ -82,10 +82,10 @@ impl Config {
validator_dir = Some(base_dir.join(DEFAULT_VALIDATOR_DIR));
secrets_dir = Some(base_dir.join(DEFAULT_SECRET_DIR));
}
if cli_args.value_of("validators-dir").is_some()
&& cli_args.value_of("secrets-dir").is_some()
{
if cli_args.value_of("validators-dir").is_some() {
validator_dir = Some(parse_required(cli_args, "validators-dir")?);
}
if cli_args.value_of("secrets-dir").is_some() {
secrets_dir = Some(parse_required(cli_args, "secrets-dir")?);
}