Remove validators subcommand

This commit is contained in:
Paul Hauner
2022-12-01 10:35:51 +11:00
parent 06f7efcc58
commit 0ece17ed32
6 changed files with 17 additions and 46 deletions

View File

@@ -1,12 +1,15 @@
use clap::App;
use clap::ArgMatches;
use common::write_to_json_file;
use environment::Environment;
use serde::Serialize;
use std::path::PathBuf;
use types::EthSpec;
use validators::common::write_to_json_file;
pub mod validators;
pub mod common;
pub mod create_validators;
pub mod import_validators;
pub mod move_validators;
pub const CMD: &str = "validator_manager";
@@ -39,7 +42,9 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
App::new(CMD)
.visible_aliases(&["vm", "validator-manager", CMD])
.about("Utilities for managing a Lighthouse validator client via the HTTP API.")
.subcommand(validators::cli_app())
.subcommand(create_validators::cli_app())
.subcommand(import_validators::cli_app())
.subcommand(move_validators::cli_app())
}
/// Run the account manager, returning an error if the operation did not succeed.
@@ -58,8 +63,14 @@ pub fn run<'a, T: EthSpec>(matches: &'a ArgMatches<'a>, env: Environment<T>) ->
.block_on_dangerous(
async {
match matches.subcommand() {
(validators::CMD, Some(matches)) => {
validators::cli_run::<T>(matches, &spec, dump_config).await
(create_validators::CMD, Some(matches)) => {
create_validators::cli_run::<T>(matches, &spec, dump_config).await
}
(import_validators::CMD, Some(matches)) => {
import_validators::cli_run(matches, dump_config).await
}
(move_validators::CMD, Some(matches)) => {
move_validators::cli_run(matches, dump_config).await
}
("", _) => Err("No command supplied. See --help.".to_string()),
(unknown, _) => Err(format!(