Skip to content

Commit

Permalink
alphabetic order
Browse files Browse the repository at this point in the history
  • Loading branch information
eserilev committed Apr 4, 2024
1 parent e320c99 commit 0c92aaa
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 26 deletions.
16 changes: 11 additions & 5 deletions account_manager/src/wallet/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ pub fn cli_app() -> Command {
"The wallet will be created with this name. It is not allowed to \
create two wallets with the same name for the same --base-dir.",
)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0)
)
.arg(
Arg::new(PASSWORD_FLAG)
Expand All @@ -56,7 +57,8 @@ pub fn cli_app() -> Command {
saved at that path. To avoid confusion, if the file does not already \
exist it must include a '.pass' suffix.",
)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0)
)
.arg(
Arg::new(TYPE_FLAG)
Expand All @@ -68,7 +70,8 @@ pub fn cli_app() -> Command {
)
.action(ArgAction::Set)
.value_parser([HD_TYPE])
.default_value(HD_TYPE),
.default_value(HD_TYPE)
.display_order(0)
)
.arg(
Arg::new(MNEMONIC_FLAG)
Expand All @@ -78,13 +81,15 @@ pub fn cli_app() -> Command {
"If present, the mnemonic will be saved to this file. DO NOT SHARE THE MNEMONIC.",
)
.action(ArgAction::Set)
.display_order(0)
)
.arg(
Arg::new(STDIN_INPUTS_FLAG)
.action(ArgAction::SetTrue)
.hide(cfg!(windows))
.long(STDIN_INPUTS_FLAG)
.help("If present, read all user inputs from stdin instead of tty."),
.help("If present, read all user inputs from stdin instead of tty.")
.display_order(0)
)
.arg(
Arg::new(MNEMONIC_LENGTH_FLAG)
Expand All @@ -109,7 +114,8 @@ pub fn cli_app() -> Command {
)),
}
})
.default_value("24"),
.default_value("24")
.display_order(0)
)
}

Expand Down
1 change: 1 addition & 0 deletions account_manager/src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub const CMD: &str = "wallet";
pub fn cli_app() -> Command {
Command::new(CMD)
.about("Manage wallets, from which validator keys can be derived.")
.display_order(0)
.arg(
Arg::new(WALLETS_DIR_FLAG)
.long(WALLETS_DIR_FLAG)
Expand Down
15 changes: 10 additions & 5 deletions account_manager/src/wallet/recover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ pub fn cli_app() -> Command {
"The wallet will be created with this name. It is not allowed to \
create two wallets with the same name for the same --base-dir.",
)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(PASSWORD_FLAG)
Expand All @@ -31,14 +32,16 @@ pub fn cli_app() -> Command {
saved at that path. To avoid confusion, if the file does not already \
exist it must include a '.pass' suffix.",
)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(MNEMONIC_FLAG)
.long(MNEMONIC_FLAG)
.value_name("MNEMONIC_PATH")
.help("If present, the mnemonic will be read in from this file.")
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(TYPE_FLAG)
Expand All @@ -50,14 +53,16 @@ pub fn cli_app() -> Command {
)
.action(ArgAction::Set)
.value_parser([HD_TYPE])
.default_value(HD_TYPE),
.default_value(HD_TYPE)
.display_order(0),
)
.arg(
Arg::new(STDIN_INPUTS_FLAG)
.action(ArgAction::SetTrue)
.hide(cfg!(windows))
.long(STDIN_INPUTS_FLAG)
.help("If present, read all user inputs from stdin instead of tty."),
.help("If present, read all user inputs from stdin instead of tty.")
.display_order(0),
)
}

Expand Down
11 changes: 10 additions & 1 deletion lighthouse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ mod metrics;

use beacon_node::ProductionBeaconNode;
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::{flags::DISABLE_MALLOC_TUNING_FLAG, get_color_style, get_eth2_network_config};
use clap_utils::{
flags::DISABLE_MALLOC_TUNING_FLAG, get_color_style, get_eth2_network_config, FLAG_HEADER,
};
use directory::{parse_path_or_default, DEFAULT_BEACON_NODE_DIR, DEFAULT_VALIDATOR_DIR};
use environment::{EnvironmentBuilder, LoggerConfig};
use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK, HARDCODED_NET_NAMES};
Expand Down Expand Up @@ -91,6 +93,7 @@ fn main() {
"DEPRECATED Enables environment logging giving access to sub-protocol logs such as discv5 and libp2p",
)
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.display_order(0)
)
.arg(
Expand Down Expand Up @@ -156,6 +159,7 @@ fn main() {
Arg::new("logfile-compress")
.long("logfile-compress")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.help(
"If present, compress old log files. This can help reduce the space needed \
to store old logs.")
Expand All @@ -166,6 +170,7 @@ fn main() {
Arg::new("logfile-no-restricted-perms")
.long("logfile-no-restricted-perms")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.help(
"If present, log files will be generated as world-readable meaning they can be read by \
any user on the machine. Note that logs can often contain sensitive information \
Expand All @@ -190,13 +195,15 @@ fn main() {
.alias("log-colour")
.help("Force outputting colors when emitting logs to the terminal.")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.global(true)
.display_order(0)
)
.arg(
Arg::new("disable-log-timestamp")
.long("disable-log-timestamp")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.help("If present, do not include timestamps in logging output.")
.global(true)
.display_order(0)
Expand Down Expand Up @@ -273,6 +280,7 @@ fn main() {
.long("immediate-shutdown")
.hide(true)
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.help(
"Shuts down immediately after the Beacon Node or Validator has successfully launched. \
Used for testing only, DO NOT USE IN PRODUCTION.")
Expand All @@ -288,6 +296,7 @@ fn main() {
specific memory allocation issues."
)
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.global(true)
.display_order(0)
)
Expand Down
3 changes: 0 additions & 3 deletions scripts/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ write_to_file() {
local file="$2"
local program="$3"

# Remove first line of cmd to get rid of commit specific numbers.
cmd=${cmd#*$'\n'}

# We need to add the header and the backticks to create the code block.
printf "# %s\n\n\`\`\`\n%s\n\`\`\`" "$program" "$cmd" > "$file"

Expand Down
36 changes: 24 additions & 12 deletions validator_manager/src/move_validators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ pub fn cli_app() -> Command {
)
.required(true)
.requires(SRC_VC_TOKEN_FLAG)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(SRC_VC_TOKEN_FLAG)
.long(SRC_VC_TOKEN_FLAG)
.value_name("PATH")
.help("The file containing a token required by the source validator client.")
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(DEST_VC_URL_FLAG)
Expand All @@ -105,14 +107,16 @@ pub fn cli_app() -> Command {
)
.required(true)
.requires(DEST_VC_TOKEN_FLAG)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(DEST_VC_TOKEN_FLAG)
.long(DEST_VC_TOKEN_FLAG)
.value_name("PATH")
.help("The file containing a token required by the destination validator client.")
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(VALIDATORS_FLAG)
Expand All @@ -122,15 +126,17 @@ pub fn cli_app() -> Command {
"The validators to be moved. Either a list of 0x-prefixed \
validator pubkeys or the keyword \"all\".",
)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(COUNT_FLAG)
.long(COUNT_FLAG)
.value_name("VALIDATOR_COUNT")
.help("The number of validators to move.")
.conflicts_with(VALIDATORS_FLAG)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(GAS_LIMIT_FLAG)
Expand All @@ -141,7 +147,8 @@ pub fn cli_app() -> Command {
to leave this as the default value by not specifying this flag.",
)
.required(false)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(FEE_RECIPIENT_FLAG)
Expand All @@ -152,7 +159,8 @@ pub fn cli_app() -> Command {
fee recipient. Omit this flag to use the default value from the VC.",
)
.required(false)
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(BUILDER_PROPOSALS_FLAG)
Expand All @@ -163,14 +171,16 @@ pub fn cli_app() -> Command {
)
.required(false)
.value_parser(["true", "false"])
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
.arg(
Arg::new(STDIN_INPUTS_FLAG)
.action(ArgAction::SetTrue)
.hide(cfg!(windows))
.long(STDIN_INPUTS_FLAG)
.help("If present, read all user inputs from stdin instead of tty."),
.help("If present, read all user inputs from stdin instead of tty.")
.display_order(0),
)
.arg(
Arg::new(BUILDER_BOOST_FACTOR_FLAG)
Expand All @@ -183,7 +193,8 @@ pub fn cli_app() -> Command {
a percentage multiplier to apply to the builder's payload value \
when choosing between a builder payload header and payload from \
the local execution node.",
),
)
.display_order(0),
)
.arg(
Arg::new(PREFER_BUILDER_PROPOSALS_FLAG)
Expand All @@ -194,7 +205,8 @@ pub fn cli_app() -> Command {
)
.required(false)
.value_parser(["true", "false"])
.action(ArgAction::Set),
.action(ArgAction::Set)
.display_order(0),
)
}

Expand Down

0 comments on commit 0c92aaa

Please sign in to comment.