Remove old command

This commit is contained in:
Paul Hauner
2022-08-17 11:53:41 +10:00
parent e463518df6
commit fec2969cd2
6 changed files with 79 additions and 728 deletions

View File

@@ -0,0 +1,32 @@
pub mod common;
pub mod create_validators;
pub mod import_validators;
use clap::{App, ArgMatches};
use environment::Environment;
use types::EthSpec;
pub const CMD: &str = "validators";
pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
App::new(CMD)
.about("Provides commands for managing validators in a Lighthouse Validator Client.")
.subcommand(create_validators::cli_app())
.subcommand(import_validators::cli_app())
}
pub async fn cli_run<'a, T: EthSpec>(
matches: &'a ArgMatches<'a>,
env: Environment<T>,
) -> Result<(), String> {
match matches.subcommand() {
(create_validators::CMD, Some(matches)) => {
create_validators::cli_run::<T>(matches, env).await
}
(import_validators::CMD, Some(matches)) => import_validators::cli_run(matches).await,
(unknown, _) => Err(format!(
"{} does not have a {} command. See --help",
CMD, unknown
)),
}
}