Migrate validator client to clap derive (#6300)

Partially #5900


  Migrate the validator client cli to clap derive
This commit is contained in:
Eitan Seri-Levi
2025-02-03 23:08:31 +03:00
committed by GitHub
parent 95cec45c38
commit 7e4b27c922
18 changed files with 653 additions and 773 deletions

View File

@@ -2,11 +2,8 @@ mod common;
pub mod validator;
pub mod wallet;
use clap::Arg;
use clap::ArgAction;
use clap::ArgMatches;
use clap::Command;
use clap_utils::FLAG_HEADER;
use environment::Environment;
use types::EthSpec;
@@ -21,15 +18,6 @@ pub fn cli_app() -> Command {
.visible_aliases(["a", "am", "account"])
.about("Utilities for generating and managing Ethereum 2.0 accounts.")
.display_order(0)
.arg(
Arg::new("help")
.long("help")
.short('h')
.help("Prints help information")
.action(ArgAction::HelpLong)
.display_order(0)
.help_heading(FLAG_HEADER),
)
.subcommand(wallet::cli_app())
.subcommand(validator::cli_app())
}

View File

@@ -8,7 +8,6 @@ pub mod slashing_protection;
use crate::{VALIDATOR_DIR_FLAG, VALIDATOR_DIR_FLAG_ALIAS};
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::FLAG_HEADER;
use directory::{parse_path_or_default_with_flag, DEFAULT_VALIDATOR_DIR};
use environment::Environment;
use std::path::PathBuf;
@@ -20,16 +19,6 @@ pub fn cli_app() -> Command {
Command::new(CMD)
.display_order(0)
.about("Provides commands for managing Eth2 validators.")
.arg(
Arg::new("help")
.long("help")
.short('h')
.help("Prints help information")
.action(ArgAction::HelpLong)
.display_order(0)
.help_heading(FLAG_HEADER)
.global(true),
)
.arg(
Arg::new(VALIDATOR_DIR_FLAG)
.long(VALIDATOR_DIR_FLAG)

View File

@@ -4,7 +4,6 @@ pub mod recover;
use crate::WALLETS_DIR_FLAG;
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::FLAG_HEADER;
use directory::{parse_path_or_default_with_flag, DEFAULT_WALLET_DIR};
use std::fs::create_dir_all;
use std::path::PathBuf;
@@ -15,16 +14,6 @@ pub fn cli_app() -> Command {
Command::new(CMD)
.about("Manage wallets, from which validator keys can be derived.")
.display_order(0)
.arg(
Arg::new("help")
.long("help")
.short('h')
.help("Prints help information")
.action(ArgAction::HelpLong)
.display_order(0)
.help_heading(FLAG_HEADER)
.global(true)
)
.arg(
Arg::new(WALLETS_DIR_FLAG)
.long(WALLETS_DIR_FLAG)