From 17818e79d41f88b58bcc483101f175b269998f41 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:24:13 +0200 Subject: [PATCH] chore(cli): fix clap deprecated warnings (#6872) Co-authored-by: Alexey Shekhirin --- bin/reth/src/cli/mod.rs | 4 ++-- bin/reth/src/commands/db/diff.rs | 2 +- bin/reth/src/commands/db/get.rs | 8 +++---- bin/reth/src/commands/db/mod.rs | 4 ++-- .../src/commands/debug_cmd/build_block.rs | 2 +- bin/reth/src/commands/debug_cmd/execution.rs | 4 ++-- .../commands/debug_cmd/in_memory_merkle.rs | 4 ++-- bin/reth/src/commands/debug_cmd/merkle.rs | 4 ++-- bin/reth/src/commands/debug_cmd/mod.rs | 2 +- .../src/commands/debug_cmd/replay_engine.rs | 4 ++-- bin/reth/src/commands/import.rs | 2 +- bin/reth/src/commands/init_cmd.rs | 2 +- bin/reth/src/commands/node/mod.rs | 21 +++++++++---------- bin/reth/src/commands/p2p/mod.rs | 4 ++-- bin/reth/src/commands/recover/mod.rs | 2 +- bin/reth/src/commands/stage/drop.rs | 2 +- bin/reth/src/commands/stage/dump/mod.rs | 4 ++-- bin/reth/src/commands/stage/mod.rs | 2 +- bin/reth/src/commands/stage/run.rs | 6 +++--- bin/reth/src/commands/stage/unwind.rs | 8 +++---- bin/reth/src/commands/test_vectors/mod.rs | 2 +- crates/node-core/src/args/database_args.rs | 4 ++-- crates/node-core/src/args/debug_args.rs | 4 ++-- crates/node-core/src/args/dev_args.rs | 4 ++-- .../src/args/gas_price_oracle_args.rs | 4 ++-- crates/node-core/src/args/log_args.rs | 6 +++--- crates/node-core/src/args/network_args.rs | 8 +++---- .../src/args/payload_builder_args.rs | 4 ++-- crates/node-core/src/args/pruning_args.rs | 4 ++-- crates/node-core/src/args/rollup_args.rs | 4 ++-- crates/node-core/src/args/rpc_server_args.rs | 10 ++++----- .../src/args/rpc_state_cache_args.rs | 2 +- crates/node-core/src/args/txpool_args.rs | 4 ++-- crates/node-core/src/cli/ext.rs | 2 +- .../src/main.rs | 2 +- 35 files changed, 77 insertions(+), 78 deletions(-) diff --git a/bin/reth/src/cli/mod.rs b/bin/reth/src/cli/mod.rs index 8c33e36e7f89..6883901fac44 100644 --- a/bin/reth/src/cli/mod.rs +++ b/bin/reth/src/cli/mod.rs @@ -32,7 +32,7 @@ pub use crate::core::cli::*; #[command(author, version = SHORT_VERSION, long_version = LONG_VERSION, about = "Reth", long_about = None)] pub struct Cli { /// The command to run - #[clap(subcommand)] + #[command(subcommand)] command: Commands, /// The chain this node is running. @@ -64,7 +64,7 @@ pub struct Cli { #[arg(long, value_name = "INSTANCE", global = true, default_value_t = 1, value_parser = value_parser!(u16).range(..=200))] instance: u16, - #[clap(flatten)] + #[command(flatten)] logs: LogArgs, } diff --git a/bin/reth/src/commands/db/diff.rs b/bin/reth/src/commands/db/diff.rs index d36278ca1b45..723a83b0ff4f 100644 --- a/bin/reth/src/commands/db/diff.rs +++ b/bin/reth/src/commands/db/diff.rs @@ -31,7 +31,7 @@ pub struct Command { secondary_datadir: PlatformPath, /// Arguments for the second database - #[clap(flatten)] + #[command(flatten)] second_db: DatabaseArgs, /// The table name to diff. If not specified, all tables are diffed. diff --git a/bin/reth/src/commands/db/get.rs b/bin/reth/src/commands/db/get.rs index 1ffe038e96a2..57672ee4c346 100644 --- a/bin/reth/src/commands/db/get.rs +++ b/bin/reth/src/commands/db/get.rs @@ -12,7 +12,7 @@ use tracing::error; /// The arguments for the `reth db get` command #[derive(Parser, Debug)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] subcommand: Subcommand, } @@ -31,7 +31,7 @@ enum Subcommand { subkey: Option, /// Output bytes instead of human-readable decoded value - #[clap(long)] + #[arg(long)] raw: bool, }, /// Gets the content of a static file segment for the given key @@ -43,7 +43,7 @@ enum Subcommand { key: String, /// Output bytes instead of human-readable decoded value - #[clap(long)] + #[arg(long)] raw: bool, }, } @@ -209,7 +209,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/bin/reth/src/commands/db/mod.rs b/bin/reth/src/commands/db/mod.rs index 92f3526d0d58..07f4566f13cb 100644 --- a/bin/reth/src/commands/db/mod.rs +++ b/bin/reth/src/commands/db/mod.rs @@ -56,10 +56,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/debug_cmd/build_block.rs b/bin/reth/src/commands/debug_cmd/build_block.rs index 67215aa54857..1990a6b3da7d 100644 --- a/bin/reth/src/commands/debug_cmd/build_block.rs +++ b/bin/reth/src/commands/debug_cmd/build_block.rs @@ -81,7 +81,7 @@ pub struct Command { chain: Arc, /// Database arguments. - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, /// Overrides the KZG trusted setup by reading from the supplied file. diff --git a/bin/reth/src/commands/debug_cmd/execution.rs b/bin/reth/src/commands/debug_cmd/execution.rs index 565852b7d7a5..e6ab1a64ca7a 100644 --- a/bin/reth/src/commands/debug_cmd/execution.rs +++ b/bin/reth/src/commands/debug_cmd/execution.rs @@ -71,10 +71,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, /// The maximum block height. diff --git a/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs b/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs index 54af17e97be1..dd703747b103 100644 --- a/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs +++ b/bin/reth/src/commands/debug_cmd/in_memory_merkle.rs @@ -60,10 +60,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, /// The number of retries per request diff --git a/bin/reth/src/commands/debug_cmd/merkle.rs b/bin/reth/src/commands/debug_cmd/merkle.rs index 8a5cce295a26..68d95f52d0e3 100644 --- a/bin/reth/src/commands/debug_cmd/merkle.rs +++ b/bin/reth/src/commands/debug_cmd/merkle.rs @@ -67,10 +67,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, /// The number of retries per request diff --git a/bin/reth/src/commands/debug_cmd/mod.rs b/bin/reth/src/commands/debug_cmd/mod.rs index 36834da51da6..1bafbdbe7ab0 100644 --- a/bin/reth/src/commands/debug_cmd/mod.rs +++ b/bin/reth/src/commands/debug_cmd/mod.rs @@ -13,7 +13,7 @@ mod replay_engine; /// `reth debug` command #[derive(Debug, Parser)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/debug_cmd/replay_engine.rs b/bin/reth/src/commands/debug_cmd/replay_engine.rs index 374844d1bbc6..77d38242284e 100644 --- a/bin/reth/src/commands/debug_cmd/replay_engine.rs +++ b/bin/reth/src/commands/debug_cmd/replay_engine.rs @@ -68,10 +68,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, /// The path to read engine API messages from. diff --git a/bin/reth/src/commands/import.rs b/bin/reth/src/commands/import.rs index f492a456d23c..56ff78127b3d 100644 --- a/bin/reth/src/commands/import.rs +++ b/bin/reth/src/commands/import.rs @@ -61,7 +61,7 @@ pub struct ImportCommand { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, /// The path to a block file for import. diff --git a/bin/reth/src/commands/init_cmd.rs b/bin/reth/src/commands/init_cmd.rs index abd3edc5bddf..bfc280994637 100644 --- a/bin/reth/src/commands/init_cmd.rs +++ b/bin/reth/src/commands/init_cmd.rs @@ -40,7 +40,7 @@ pub struct InitCommand { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, } diff --git a/bin/reth/src/commands/node/mod.rs b/bin/reth/src/commands/node/mod.rs index b76902acb2d3..bf8ac313876f 100644 --- a/bin/reth/src/commands/node/mod.rs +++ b/bin/reth/src/commands/node/mod.rs @@ -85,45 +85,44 @@ pub struct NodeCommand { pub trusted_setup_file: Option, /// All networking related arguments - #[clap(flatten)] + #[command(flatten)] pub network: NetworkArgs, /// All rpc related arguments - #[clap(flatten)] + #[command(flatten)] pub rpc: RpcServerArgs, /// All txpool related arguments with --txpool prefix - #[clap(flatten)] + #[command(flatten)] pub txpool: TxPoolArgs, /// All payload builder related arguments - #[clap(flatten)] + #[command(flatten)] pub builder: PayloadBuilderArgs, /// All debug related arguments with --debug prefix - #[clap(flatten)] + #[command(flatten)] pub debug: DebugArgs, /// All database related arguments - #[clap(flatten)] + #[command(flatten)] pub db: DatabaseArgs, /// All dev related arguments with --dev prefix - #[clap(flatten)] + #[command(flatten)] pub dev: DevArgs, /// All pruning related arguments - #[clap(flatten)] + #[command(flatten)] pub pruning: PruningArgs, /// Rollup related arguments #[cfg(feature = "optimism")] - #[clap(flatten)] + #[command(flatten)] pub rollup: crate::args::RollupArgs, /// Additional cli arguments - #[clap(flatten)] - #[clap(next_help_heading = "Extension")] + #[command(flatten, next_help_heading = "Extension")] pub ext: Ext::Node, } diff --git a/bin/reth/src/commands/p2p/mod.rs b/bin/reth/src/commands/p2p/mod.rs index 0dbcd6c270bf..e50ea363112b 100644 --- a/bin/reth/src/commands/p2p/mod.rs +++ b/bin/reth/src/commands/p2p/mod.rs @@ -73,10 +73,10 @@ pub struct Command { #[arg(long, default_value = "any")] nat: NatResolver, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/recover/mod.rs b/bin/reth/src/commands/recover/mod.rs index 044438f247f4..b1f778feac87 100644 --- a/bin/reth/src/commands/recover/mod.rs +++ b/bin/reth/src/commands/recover/mod.rs @@ -8,7 +8,7 @@ mod storage_tries; /// `reth recover` command #[derive(Debug, Parser)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/stage/drop.rs b/bin/reth/src/commands/stage/drop.rs index 3a5620331c97..79147355447b 100644 --- a/bin/reth/src/commands/stage/drop.rs +++ b/bin/reth/src/commands/stage/drop.rs @@ -45,7 +45,7 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, stage: StageEnum, diff --git a/bin/reth/src/commands/stage/dump/mod.rs b/bin/reth/src/commands/stage/dump/mod.rs index f85ce0e8b399..6f32bbd847a2 100644 --- a/bin/reth/src/commands/stage/dump/mod.rs +++ b/bin/reth/src/commands/stage/dump/mod.rs @@ -58,10 +58,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(subcommand)] + #[command(subcommand)] command: Stages, } diff --git a/bin/reth/src/commands/stage/mod.rs b/bin/reth/src/commands/stage/mod.rs index a3e2fa19ebbf..fa9bda84295e 100644 --- a/bin/reth/src/commands/stage/mod.rs +++ b/bin/reth/src/commands/stage/mod.rs @@ -10,7 +10,7 @@ pub mod unwind; /// `reth stage` command #[derive(Debug, Parser)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/bin/reth/src/commands/stage/run.rs b/bin/reth/src/commands/stage/run.rs index 5cd3ded0ba86..e0016e646f39 100644 --- a/bin/reth/src/commands/stage/run.rs +++ b/bin/reth/src/commands/stage/run.rs @@ -63,7 +63,7 @@ pub struct Command { /// Enable Prometheus metrics. /// /// The metrics will be served at the given interface and port. - #[clap(long, value_name = "SOCKET")] + #[arg(long, value_name = "SOCKET")] metrics: Option, /// The name of the stage to run @@ -90,10 +90,10 @@ pub struct Command { #[arg(long, short)] skip_unwind: bool, - #[clap(flatten)] + #[command(flatten)] network: NetworkArgs, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, /// Commits the changes in the database. WARNING: potentially destructive. diff --git a/bin/reth/src/commands/stage/unwind.rs b/bin/reth/src/commands/stage/unwind.rs index 44d4c2845fa1..ce791b936a81 100644 --- a/bin/reth/src/commands/stage/unwind.rs +++ b/bin/reth/src/commands/stage/unwind.rs @@ -42,10 +42,10 @@ pub struct Command { )] chain: Arc, - #[clap(flatten)] + #[command(flatten)] db: DatabaseArgs, - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } @@ -87,10 +87,10 @@ impl Command { #[derive(Subcommand, Debug, Eq, PartialEq)] enum Subcommands { /// Unwinds the database until the given block number (range is inclusive). - #[clap(name = "to-block")] + #[command(name = "to-block")] ToBlock { target: BlockHashOrNumber }, /// Unwinds the given number of blocks from the database. - #[clap(name = "num-blocks")] + #[command(name = "num-blocks")] NumBlocks { amount: u64 }, } diff --git a/bin/reth/src/commands/test_vectors/mod.rs b/bin/reth/src/commands/test_vectors/mod.rs index 7315b6006150..999c0bc91320 100644 --- a/bin/reth/src/commands/test_vectors/mod.rs +++ b/bin/reth/src/commands/test_vectors/mod.rs @@ -7,7 +7,7 @@ mod tables; /// Generate test-vectors for different data types. #[derive(Debug, Parser)] pub struct Command { - #[clap(subcommand)] + #[command(subcommand)] command: Subcommands, } diff --git a/crates/node-core/src/args/database_args.rs b/crates/node-core/src/args/database_args.rs index edaa26bbfaec..10f4d6b1e26c 100644 --- a/crates/node-core/src/args/database_args.rs +++ b/crates/node-core/src/args/database_args.rs @@ -5,7 +5,7 @@ use reth_interfaces::db::LogLevel; /// Parameters for database configuration #[derive(Debug, Args, PartialEq, Default, Clone, Copy)] -#[clap(next_help_heading = "Database")] +#[command(next_help_heading = "Database")] pub struct DatabaseArgs { /// Database logging level. Levels higher than "notice" require a debug build. #[arg(long = "db.log-level", value_enum)] @@ -20,7 +20,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/debug_args.rs b/crates/node-core/src/args/debug_args.rs index 104c8b2730b2..59b068e5cdcf 100644 --- a/crates/node-core/src/args/debug_args.rs +++ b/crates/node-core/src/args/debug_args.rs @@ -6,7 +6,7 @@ use std::path::PathBuf; /// Parameters for debugging purposes #[derive(Debug, Clone, Args, PartialEq, Default)] -#[clap(next_help_heading = "Debug")] +#[command(next_help_heading = "Debug")] pub struct DebugArgs { /// Prompt the downloader to download blocks one at a time. /// @@ -74,7 +74,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/dev_args.rs b/crates/node-core/src/args/dev_args.rs index 929b3fd10c6f..baea7b7147ca 100644 --- a/crates/node-core/src/args/dev_args.rs +++ b/crates/node-core/src/args/dev_args.rs @@ -7,7 +7,7 @@ use humantime::parse_duration; /// Parameters for Dev testnet configuration #[derive(Debug, Args, PartialEq, Default, Clone, Copy)] -#[clap(next_help_heading = "Dev testnet")] +#[command(next_help_heading = "Dev testnet")] pub struct DevArgs { /// Start the node in dev mode /// @@ -49,7 +49,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/gas_price_oracle_args.rs b/crates/node-core/src/args/gas_price_oracle_args.rs index 54087693af7a..63b5e4b7649b 100644 --- a/crates/node-core/src/args/gas_price_oracle_args.rs +++ b/crates/node-core/src/args/gas_price_oracle_args.rs @@ -8,7 +8,7 @@ use reth_rpc_builder::constants::{ /// Parameters to configure Gas Price Oracle #[derive(Debug, Clone, Copy, Args, PartialEq, Eq)] -#[clap(next_help_heading = "Gas Price Oracle")] +#[command(next_help_heading = "Gas Price Oracle")] pub struct GasPriceOracleArgs { /// Number of recent blocks to check for gas price #[arg(long = "gpo.blocks", default_value_t = DEFAULT_GAS_PRICE_BLOCKS)] @@ -59,7 +59,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/log_args.rs b/crates/node-core/src/args/log_args.rs index 49435bded080..e5475e2697a8 100644 --- a/crates/node-core/src/args/log_args.rs +++ b/crates/node-core/src/args/log_args.rs @@ -67,7 +67,7 @@ pub struct LogArgs { )] pub color: ColorMode, /// The verbosity settings for the tracer. - #[clap(flatten)] + #[command(flatten)] pub verbosity: Verbosity, } @@ -145,11 +145,11 @@ pub struct Verbosity { /// -vvv Info /// -vvvv Debug /// -vvvvv Traces (warning: very verbose!) - #[clap(short, long, action = ArgAction::Count, global = true, default_value_t = 3, verbatim_doc_comment, help_heading = "Display")] + #[arg(short, long, action = ArgAction::Count, global = true, default_value_t = 3, verbatim_doc_comment, help_heading = "Display")] verbosity: u8, /// Silence all log output. - #[clap(long, alias = "silent", short = 'q', global = true, help_heading = "Display")] + #[arg(long, alias = "silent", short = 'q', global = true, help_heading = "Display")] quiet: bool, } diff --git a/crates/node-core/src/args/network_args.rs b/crates/node-core/src/args/network_args.rs index 75119f0ae8d3..caa6b580e23c 100644 --- a/crates/node-core/src/args/network_args.rs +++ b/crates/node-core/src/args/network_args.rs @@ -19,7 +19,7 @@ use std::{net::Ipv4Addr, path::PathBuf, sync::Arc}; /// Parameters for configuring the network more granularity via CLI #[derive(Debug, Clone, Args, PartialEq, Eq)] -#[clap(next_help_heading = "Networking")] +#[command(next_help_heading = "Networking")] pub struct NetworkArgs { /// Disable the discovery service. #[command(flatten)] @@ -211,11 +211,11 @@ pub struct DiscoveryArgs { pub disable_discv4_discovery: bool, /// The UDP address to use for P2P discovery/networking - #[arg(long = "discovery.addr", name = "discovery.addr", value_name = "DISCOVERY_ADDR", default_value_t = DEFAULT_DISCOVERY_ADDR)] + #[arg(id = "discovery.addr", long = "discovery.addr", value_name = "DISCOVERY_ADDR", default_value_t = DEFAULT_DISCOVERY_ADDR)] pub addr: Ipv4Addr, /// The UDP port to use for P2P discovery/networking - #[arg(long = "discovery.port", name = "discovery.port", value_name = "DISCOVERY_PORT", default_value_t = DEFAULT_DISCOVERY_PORT)] + #[arg(id = "discovery.port", long = "discovery.port", value_name = "DISCOVERY_PORT", default_value_t = DEFAULT_DISCOVERY_PORT)] pub port: u16, } @@ -262,7 +262,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/payload_builder_args.rs b/crates/node-core/src/args/payload_builder_args.rs index b47fd2838e55..44250ffd5e86 100644 --- a/crates/node-core/src/args/payload_builder_args.rs +++ b/crates/node-core/src/args/payload_builder_args.rs @@ -13,7 +13,7 @@ use std::{borrow::Cow, ffi::OsStr, time::Duration}; /// Parameters for configuring the Payload Builder #[derive(Debug, Clone, Args, PartialEq)] -#[clap(next_help_heading = "Builder")] +#[command(next_help_heading = "Builder")] pub struct PayloadBuilderArgs { /// Block extra data set by the payload builder. #[arg(long = "builder.extradata", value_parser = ExtradataValueParser::default(), default_value_t = default_extradata())] @@ -124,7 +124,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/pruning_args.rs b/crates/node-core/src/args/pruning_args.rs index 86808e3ba18f..b89cca570512 100644 --- a/crates/node-core/src/args/pruning_args.rs +++ b/crates/node-core/src/args/pruning_args.rs @@ -9,7 +9,7 @@ use std::sync::Arc; /// Parameters for pruning and full node #[derive(Debug, Clone, Args, PartialEq, Default)] -#[clap(next_help_heading = "Pruning")] +#[command(next_help_heading = "Pruning")] pub struct PruningArgs { /// Run full node. Only the most recent [`MINIMUM_PRUNING_DISTANCE`] block states are stored. /// This flag takes priority over pruning configuration in reth.toml. @@ -56,7 +56,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/rollup_args.rs b/crates/node-core/src/args/rollup_args.rs index 1ffaae0516b6..d56b4caaee24 100644 --- a/crates/node-core/src/args/rollup_args.rs +++ b/crates/node-core/src/args/rollup_args.rs @@ -2,7 +2,7 @@ /// Parameters for rollup configuration #[derive(Debug, Clone, Default, PartialEq, Eq, clap::Args)] -#[clap(next_help_heading = "Rollup")] +#[command(next_help_heading = "Rollup")] pub struct RollupArgs { /// HTTP endpoint for the sequencer mempool #[arg(long = "rollup.sequencer-http", value_name = "HTTP_URL")] @@ -26,7 +26,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/rpc_server_args.rs b/crates/node-core/src/args/rpc_server_args.rs index fe2a27df9cec..4547a7068469 100644 --- a/crates/node-core/src/args/rpc_server_args.rs +++ b/crates/node-core/src/args/rpc_server_args.rs @@ -61,7 +61,7 @@ pub(crate) const RPC_DEFAULT_MAX_CONNECTIONS: u32 = 500; /// Parameters for configuring the rpc more granularity via CLI #[derive(Debug, Clone, Args, PartialEq, Eq)] -#[clap(next_help_heading = "RPC")] +#[command(next_help_heading = "RPC")] pub struct RpcServerArgs { /// Enable the HTTP-RPC server #[arg(long, default_value_if("dev", "true", "true"))] @@ -96,7 +96,7 @@ pub struct RpcServerArgs { pub ws_port: u16, /// Origins from which to accept WebSocket requests - #[arg(long = "ws.origins", name = "ws.origins")] + #[arg(id = "ws.origins", long = "ws.origins")] pub ws_allowed_origins: Option, /// Rpc Modules to be configured for the WS server @@ -175,11 +175,11 @@ pub struct RpcServerArgs { pub rpc_gas_cap: u64, /// State cache configuration. - #[clap(flatten)] + #[command(flatten)] pub rpc_state_cache: RpcStateCacheArgs, /// Gas price oracle configuration. - #[clap(flatten)] + #[command(flatten)] pub gas_price_oracle: GasPriceOracleArgs, } @@ -631,7 +631,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/args/rpc_state_cache_args.rs b/crates/node-core/src/args/rpc_state_cache_args.rs index df909dbbd4bd..bb152e66c753 100644 --- a/crates/node-core/src/args/rpc_state_cache_args.rs +++ b/crates/node-core/src/args/rpc_state_cache_args.rs @@ -6,7 +6,7 @@ use reth_rpc::eth::cache::{ /// Parameters to configure RPC state cache. #[derive(Debug, Clone, Args, PartialEq, Eq)] -#[clap(next_help_heading = "RPC State Cache")] +#[command(next_help_heading = "RPC State Cache")] pub struct RpcStateCacheArgs { /// Max number of blocks in cache. diff --git a/crates/node-core/src/args/txpool_args.rs b/crates/node-core/src/args/txpool_args.rs index 186ddf78a64d..e349f170bbb9 100644 --- a/crates/node-core/src/args/txpool_args.rs +++ b/crates/node-core/src/args/txpool_args.rs @@ -11,7 +11,7 @@ use reth_transaction_pool::{ }; /// Parameters for debugging purposes #[derive(Debug, Clone, Args, PartialEq)] -#[clap(next_help_heading = "TxPool")] +#[command(next_help_heading = "TxPool")] pub struct TxPoolArgs { /// Max number of transaction in the pending sub-pool. #[arg(long = "txpool.pending_max_count", default_value_t = TXPOOL_SUBPOOL_MAX_TXS_DEFAULT)] @@ -128,7 +128,7 @@ mod tests { /// A helper type to parse Args more easily #[derive(Parser)] struct CommandParser { - #[clap(flatten)] + #[command(flatten)] args: T, } diff --git a/crates/node-core/src/cli/ext.rs b/crates/node-core/src/cli/ext.rs index ce2c39f7f1d7..178e7ea87335 100644 --- a/crates/node-core/src/cli/ext.rs +++ b/crates/node-core/src/cli/ext.rs @@ -209,7 +209,7 @@ impl RethCliExt for NoArgsCliExt { /// the reth node command. #[derive(Debug, Clone, Copy, Default, Args)] pub struct NoArgs { - #[clap(skip)] + #[arg(skip)] inner: Option, } diff --git a/examples/additional-rpc-namespace-in-cli/src/main.rs b/examples/additional-rpc-namespace-in-cli/src/main.rs index f7d1b18f6cfd..1221efde51d9 100644 --- a/examples/additional-rpc-namespace-in-cli/src/main.rs +++ b/examples/additional-rpc-namespace-in-cli/src/main.rs @@ -38,7 +38,7 @@ impl RethCliExt for MyRethCliExt { #[derive(Debug, Clone, Copy, Default, clap::Args)] struct RethCliTxpoolExt { /// CLI flag to enable the txpool extension namespace - #[clap(long)] + #[arg(long)] pub enable_ext: bool, }