chore(cli): fix clap deprecated warnings (#6872)

Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
This commit is contained in:
DaniPopes
2024-02-29 15:24:13 +02:00
committed by GitHub
parent 6b5b6f7a40
commit 17818e79d4
35 changed files with 77 additions and 78 deletions

View File

@ -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<Ext: RethCliExt = ()> {
/// The command to run
#[clap(subcommand)]
#[command(subcommand)]
command: Commands<Ext>,
/// The chain this node is running.
@ -64,7 +64,7 @@ pub struct Cli<Ext: RethCliExt = ()> {
#[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,
}

View File

@ -31,7 +31,7 @@ pub struct Command {
secondary_datadir: PlatformPath<DataDirPath>,
/// Arguments for the second database
#[clap(flatten)]
#[command(flatten)]
second_db: DatabaseArgs,
/// The table name to diff. If not specified, all tables are diffed.

View File

@ -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<String>,
/// 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<T: Args> {
#[clap(flatten)]
#[command(flatten)]
args: T,
}

View File

@ -56,10 +56,10 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
#[clap(subcommand)]
#[command(subcommand)]
command: Subcommands,
}

View File

@ -81,7 +81,7 @@ pub struct Command {
chain: Arc<ChainSpec>,
/// Database arguments.
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
/// Overrides the KZG trusted setup by reading from the supplied file.

View File

@ -71,10 +71,10 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
network: NetworkArgs,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
/// The maximum block height.

View File

@ -60,10 +60,10 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
#[clap(flatten)]
#[command(flatten)]
network: NetworkArgs,
/// The number of retries per request

View File

@ -67,10 +67,10 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
#[clap(flatten)]
#[command(flatten)]
network: NetworkArgs,
/// The number of retries per request

View File

@ -13,7 +13,7 @@ mod replay_engine;
/// `reth debug` command
#[derive(Debug, Parser)]
pub struct Command {
#[clap(subcommand)]
#[command(subcommand)]
command: Subcommands,
}

View File

@ -68,10 +68,10 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
#[clap(flatten)]
#[command(flatten)]
network: NetworkArgs,
/// The path to read engine API messages from.

View File

@ -61,7 +61,7 @@ pub struct ImportCommand {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
/// The path to a block file for import.

View File

@ -40,7 +40,7 @@ pub struct InitCommand {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
}

View File

@ -85,45 +85,44 @@ pub struct NodeCommand<Ext: RethCliExt = ()> {
pub trusted_setup_file: Option<PathBuf>,
/// 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,
}

View File

@ -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,
}

View File

@ -8,7 +8,7 @@ mod storage_tries;
/// `reth recover` command
#[derive(Debug, Parser)]
pub struct Command {
#[clap(subcommand)]
#[command(subcommand)]
command: Subcommands,
}

View File

@ -45,7 +45,7 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
stage: StageEnum,

View File

@ -58,10 +58,10 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,
#[clap(flatten)]
#[command(flatten)]
db: DatabaseArgs,
#[clap(subcommand)]
#[command(subcommand)]
command: Stages,
}

View File

@ -10,7 +10,7 @@ pub mod unwind;
/// `reth stage` command
#[derive(Debug, Parser)]
pub struct Command {
#[clap(subcommand)]
#[command(subcommand)]
command: Subcommands,
}

View File

@ -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<SocketAddr>,
/// 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.

View File

@ -42,10 +42,10 @@ pub struct Command {
)]
chain: Arc<ChainSpec>,
#[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 },
}

View File

@ -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,
}