mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
upgrade clap to v4.5 (#5273)
* upgrade clap to v4.5 * cli fixes * Merge branch 'unstable' of https://github.com/sigp/lighthouse into upgrade-clap-cli * value parser for mnemonic * Merge branch 'unstable' of https://github.com/sigp/lighthouse into upgrade-clap-cli * merge unstable * default --format val * fix eth sim * fix eth sim * merge conflicts * resolve beta compiler issue * add num args, version * add custom flag parser, make rate limiter flags clap friendly * remove unneeded check * fmt * update * alphabetic order * resolve merge conflict * fix test * resolve conflicts * fix test * revert removed if statement * fmt got me again * fix broken flag * make cli * make cli * update * remove -e files * update * cli help updates * Merge branch 'unstable' of https://github.com/sigp/lighthouse into upgrade-clap-cli * cli help updates * md files * merge conflict * merge conflicts * md * help text, text width, and a few flag fixes * fmt * merge * revert * revert * resolve merge conflicts * merge conflicts * revert simulator changes * require at least one arg * fix eth sim cli * resolve merge conflicts * book changes * md changes * cli check * cli check * retry cli check * retry cli check * Merge branch 'unstable' of https://github.com/sigp/lighthouse into upgrade-clap-cli * cli * Merge remote-tracking branch 'origin/unstable' into upgrade-clap-cli * Update CLI docs for Goerli removal * Fix cargo lock
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
use clap::{App, Arg, SubCommand};
|
||||
use clap::{crate_version, Arg, ArgAction, Command};
|
||||
|
||||
pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
App::new("simulator")
|
||||
pub fn cli_app() -> Command {
|
||||
Command::new("simulator")
|
||||
.version(crate_version!())
|
||||
.author("Sigma Prime <contact@sigmaprime.io>")
|
||||
.about("Options for interacting with simulator")
|
||||
.subcommand(
|
||||
SubCommand::with_name("basic-sim")
|
||||
Command::new("basic-sim")
|
||||
.about(
|
||||
"Runs a Beacon Chain simulation with `n` beacon node and validator clients, \
|
||||
each with `v` validators. \
|
||||
@@ -16,55 +16,55 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
exit immediately.",
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("nodes")
|
||||
.short("n")
|
||||
Arg::new("nodes")
|
||||
.short('n')
|
||||
.long("nodes")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("3")
|
||||
.help("Number of beacon nodes"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("proposer-nodes")
|
||||
.short("p")
|
||||
Arg::new("proposer-nodes")
|
||||
.short('p')
|
||||
.long("proposer-nodes")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("3")
|
||||
.help("Number of proposer-only beacon nodes"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("validators-per-node")
|
||||
.short("v")
|
||||
Arg::new("validators-per-node")
|
||||
.short('v')
|
||||
.long("validators-per-node")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("20")
|
||||
.help("Number of validators"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("speed-up-factor")
|
||||
.short("s")
|
||||
Arg::new("speed-up-factor")
|
||||
.short('s')
|
||||
.long("speed-up-factor")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("3")
|
||||
.help("Speed up factor. Please use a divisor of 12."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("debug-level")
|
||||
.short("d")
|
||||
Arg::new("debug-level")
|
||||
.short('d')
|
||||
.long("debug-level")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("debug")
|
||||
.help("Set the severity level of the logs."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("continue-after-checks")
|
||||
.short("c")
|
||||
Arg::new("continue-after-checks")
|
||||
.short('c')
|
||||
.long("continue_after_checks")
|
||||
.takes_value(false)
|
||||
.action(ArgAction::SetTrue)
|
||||
.help("Continue after checks (default false)"),
|
||||
),
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("fallback-sim")
|
||||
Command::new("fallback-sim")
|
||||
.about(
|
||||
"Runs a Beacon Chain simulation with `c` validator clients where each VC is \
|
||||
connected to `b` beacon nodes with `v` validators. \
|
||||
@@ -76,50 +76,50 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
Otherwise, the simulation will exit and an error will be reported.",
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("vc-count")
|
||||
.short("c")
|
||||
Arg::new("vc-count")
|
||||
.short('c')
|
||||
.long("vc-count")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("3")
|
||||
.help("Number of validator clients."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("bns-per-vc")
|
||||
.short("b")
|
||||
Arg::new("bns-per-vc")
|
||||
.short('b')
|
||||
.long("bns-per-vc")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("2")
|
||||
.help("Number of beacon nodes per validator client."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("validators-per-vc")
|
||||
.short("v")
|
||||
Arg::new("validators-per-vc")
|
||||
.short('v')
|
||||
.long("validators-per-vc")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("20")
|
||||
.help("Number of validators per client."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("speed-up-factor")
|
||||
.short("s")
|
||||
Arg::new("speed-up-factor")
|
||||
.short('s')
|
||||
.long("speed-up-factor")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("3")
|
||||
.help("Speed up factor. Please use a divisor of 12."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("debug-level")
|
||||
.short("d")
|
||||
Arg::new("debug-level")
|
||||
.short('d')
|
||||
.long("debug-level")
|
||||
.takes_value(true)
|
||||
.action(ArgAction::Set)
|
||||
.default_value("debug")
|
||||
.help("Set the severity level of the logs."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("continue-after-checks")
|
||||
.short("c")
|
||||
Arg::new("continue-after-checks")
|
||||
.short('c')
|
||||
.long("continue_after_checks")
|
||||
.takes_value(false)
|
||||
.action(ArgAction::SetTrue)
|
||||
.help("Continue after checks (default false)"),
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user