mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(cli): fix clap deprecated warnings (#6872)
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
This commit is contained in:
@ -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,
|
||||
}
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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,
|
||||
}
|
||||
|
||||
|
||||
@ -56,10 +56,10 @@ pub struct Command {
|
||||
)]
|
||||
chain: Arc<ChainSpec>,
|
||||
|
||||
#[clap(flatten)]
|
||||
#[command(flatten)]
|
||||
db: DatabaseArgs,
|
||||
|
||||
#[clap(subcommand)]
|
||||
#[command(subcommand)]
|
||||
command: Subcommands,
|
||||
}
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -13,7 +13,7 @@ mod replay_engine;
|
||||
/// `reth debug` command
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Command {
|
||||
#[clap(subcommand)]
|
||||
#[command(subcommand)]
|
||||
command: Subcommands,
|
||||
}
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -61,7 +61,7 @@ pub struct ImportCommand {
|
||||
)]
|
||||
chain: Arc<ChainSpec>,
|
||||
|
||||
#[clap(flatten)]
|
||||
#[command(flatten)]
|
||||
db: DatabaseArgs,
|
||||
|
||||
/// The path to a block file for import.
|
||||
|
||||
@ -40,7 +40,7 @@ pub struct InitCommand {
|
||||
)]
|
||||
chain: Arc<ChainSpec>,
|
||||
|
||||
#[clap(flatten)]
|
||||
#[command(flatten)]
|
||||
db: DatabaseArgs,
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ mod storage_tries;
|
||||
/// `reth recover` command
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Command {
|
||||
#[clap(subcommand)]
|
||||
#[command(subcommand)]
|
||||
command: Subcommands,
|
||||
}
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ pub struct Command {
|
||||
)]
|
||||
chain: Arc<ChainSpec>,
|
||||
|
||||
#[clap(flatten)]
|
||||
#[command(flatten)]
|
||||
db: DatabaseArgs,
|
||||
|
||||
stage: StageEnum,
|
||||
|
||||
@ -58,10 +58,10 @@ pub struct Command {
|
||||
)]
|
||||
chain: Arc<ChainSpec>,
|
||||
|
||||
#[clap(flatten)]
|
||||
#[command(flatten)]
|
||||
db: DatabaseArgs,
|
||||
|
||||
#[clap(subcommand)]
|
||||
#[command(subcommand)]
|
||||
command: Stages,
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ pub mod unwind;
|
||||
/// `reth stage` command
|
||||
#[derive(Debug, Parser)]
|
||||
pub struct Command {
|
||||
#[clap(subcommand)]
|
||||
#[command(subcommand)]
|
||||
command: Subcommands,
|
||||
}
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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 },
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user