diff --git a/account_manager/src/validator/deposit.rs b/account_manager/src/validator/deposit.rs index f83e11891..6ff002b0f 100644 --- a/account_manager/src/validator/deposit.rs +++ b/account_manager/src/validator/deposit.rs @@ -50,7 +50,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .long(VALIDATOR_DIR_FLAG) .value_name("VALIDATOR_DIRECTORY") .help( - "The path the validator client data directory. \ + "The path to the validator client data directory. \ Defaults to ~/.lighthouse/validators", ) .takes_value(true), diff --git a/account_manager/src/validator/list.rs b/account_manager/src/validator/list.rs index b594a7295..148564303 100644 --- a/account_manager/src/validator/list.rs +++ b/account_manager/src/validator/list.rs @@ -1,12 +1,23 @@ use crate::VALIDATOR_DIR_FLAG; -use clap::{App, ArgMatches}; +use clap::{App, Arg, ArgMatches}; use std::path::PathBuf; use validator_dir::Manager as ValidatorManager; pub const CMD: &str = "list"; pub fn cli_app<'a, 'b>() -> App<'a, 'b> { - App::new(CMD).about("Lists the names of all validators.") + App::new(CMD) + .arg( + Arg::with_name(VALIDATOR_DIR_FLAG) + .long(VALIDATOR_DIR_FLAG) + .value_name("VALIDATOR_DIRECTORY") + .help( + "The path to search for validator directories. \ + Defaults to ~/.lighthouse/validators", + ) + .takes_value(true), + ) + .about("Lists the names of all validators.") } pub fn cli_run(matches: &ArgMatches<'_>) -> Result<(), String> { diff --git a/account_manager/src/wallet/mod.rs b/account_manager/src/wallet/mod.rs index fb1c5869f..fbb1207de 100644 --- a/account_manager/src/wallet/mod.rs +++ b/account_manager/src/wallet/mod.rs @@ -11,7 +11,7 @@ pub const CMD: &str = "wallet"; pub fn cli_app<'a, 'b>() -> App<'a, 'b> { App::new(CMD) - .about("TODO") + .about("Manage wallets, from which validator keys can be derived.") .arg( Arg::with_name(BASE_DIR_FLAG) .long(BASE_DIR_FLAG) diff --git a/common/validator_dir/src/manager.rs b/common/validator_dir/src/manager.rs index 77011570e..a2a50d106 100644 --- a/common/validator_dir/src/manager.rs +++ b/common/validator_dir/src/manager.rs @@ -2,7 +2,7 @@ use crate::{Error as ValidatorDirError, ValidatorDir}; use bls::Keypair; use rayon::prelude::*; use slog::{info, warn, Logger}; -use std::collections::HashMap; +use std::collections::BTreeMap; use std::fs::read_dir; use std::io; use std::iter::FromIterator; @@ -163,13 +163,13 @@ impl Manager { /// ## Errors /// /// Returns an error if a directory is unable to be read. - pub fn directory_names(&self) -> Result, Error> { - Ok(HashMap::from_iter(self.iter_dir()?.into_iter().filter_map( - |path| { + pub fn directory_names(&self) -> Result, Error> { + Ok(BTreeMap::from_iter( + self.iter_dir()?.into_iter().filter_map(|path| { path.file_name() .and_then(|os_string| os_string.to_str().map(|s| s.to_string())) .map(|filename| (filename, path)) - }, - ))) + }), + )) } }