Skip to content

Commit e77fb01

Browse files
Remove CLI conflict for secrets-dir and datadir (#7265)
Redo this PR: - #5480 After a regression during the switch to `clap_derive`. - #6300 - Remove `conflicts_with` - Add test to prevent future regression
1 parent 591fb7d commit e77fb01

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lighthouse/tests/validator_client.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ fn validators_and_secrets_dir_flags() {
7070
});
7171
}
7272

73+
#[test]
74+
fn datadir_and_secrets_dir_flags() {
75+
let dir = TempDir::new().expect("Unable to create temporary directory");
76+
CommandLineTest::new()
77+
.flag("datadir", dir.path().join("data").to_str())
78+
.flag("secrets-dir", dir.path().join("secrets").to_str())
79+
.run_with_no_datadir()
80+
.with_config(|config| {
81+
assert_eq!(
82+
config.validator_dir,
83+
dir.path().join("data").join("validators")
84+
);
85+
assert_eq!(config.secrets_dir, dir.path().join("secrets"));
86+
});
87+
}
88+
7389
#[test]
7490
fn validators_dir_alias_flags() {
7591
let dir = TempDir::new().expect("Unable to create temporary directory");

validator_client/src/cli.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ pub struct ValidatorClient {
6767
#[clap(
6868
long,
6969
value_name = "SECRETS_DIRECTORY",
70-
conflicts_with = "datadir",
7170
help = "The directory which contains the password to unlock the validator \
7271
voting keypairs. Each password should be contained in a file where the \
7372
name is the 0x-prefixed hex representation of the validators voting public \

0 commit comments

Comments
 (0)