Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update clap to version 4 #1745

Merged
merged 10 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 48 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

[dependencies]
clap = { version = "3.2.22", features = ["derive", "deprecated"] }
clap = { version = "4.0.9", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
url = "2.3.1"

Expand Down
24 changes: 12 additions & 12 deletions client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ use url::Url;
#[derive(Debug, clap::Parser)]
pub struct PurgeChainCmd {
/// The base struct of the purge-chain command.
#[clap(flatten)]
#[command(flatten)]
pub base: sc_cli::PurgeChainCmd,

/// Only delete the para chain database
#[clap(long, aliases = &["para"])]
#[arg(long, aliases = &["para"])]
pub parachain: bool,

/// Only delete the relay chain database
#[clap(long, aliases = &["relay"])]
#[arg(long, aliases = &["relay"])]
pub relaychain: bool,
}

Expand Down Expand Up @@ -131,15 +131,15 @@ impl sc_cli::CliConfiguration for PurgeChainCmd {
#[derive(Debug, clap::Parser)]
pub struct ExportGenesisStateCommand {
/// Output file name or stdout if unspecified.
#[clap(action)]
#[arg()]
pub output: Option<PathBuf>,

/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
#[arg(short, long)]
pub raw: bool,

#[allow(missing_docs)]
#[clap(flatten)]
#[command(flatten)]
pub shared_params: sc_cli::SharedParams,
}

Expand Down Expand Up @@ -214,15 +214,15 @@ impl sc_cli::CliConfiguration for ExportGenesisStateCommand {
#[derive(Debug, clap::Parser)]
pub struct ExportGenesisWasmCommand {
/// Output file name or stdout if unspecified.
#[clap(action)]
#[arg()]
pub output: Option<PathBuf>,

/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
#[arg(short, long)]
pub raw: bool,

#[allow(missing_docs)]
#[clap(flatten)]
#[command(flatten)]
pub shared_params: sc_cli::SharedParams,
}

Expand Down Expand Up @@ -279,17 +279,17 @@ fn validate_relay_chain_url(arg: &str) -> Result<Url, String> {
#[derive(Debug, clap::Parser)]
pub struct RunCmd {
/// The cumulus RunCmd inherents from sc_cli's
#[clap(flatten)]
#[command(flatten)]
pub base: sc_cli::RunCmd,

/// Run node as collator.
///
/// Note that this is the same as running with `--validator`.
#[clap(long, conflicts_with = "validator")]
#[arg(long, conflicts_with = "validator")]
pub collator: bool,

/// EXPERIMENTAL: Specify an URL to a relay chain full node to communicate with.
#[clap(
#[arg(
long,
value_parser = validate_relay_chain_url
)]
Expand Down
2 changes: 1 addition & 1 deletion parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2021"
build = "build.rs"

[dependencies]
clap = { version = "3.2.22", features = ["derive"] }
clap = { version = "4.0.9", features = ["derive"] }
log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.145", features = ["derive"] }
Expand Down
12 changes: 6 additions & 6 deletions parachain-template/node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ pub enum Subcommand {

/// Sub-commands concerned with benchmarking.
/// The pallet benchmarking moved to the `pallet` sub-command.
#[clap(subcommand)]
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some testing command against a specified runtime state.
TryRuntime(try_runtime_cli::TryRuntimeCmd),
}

#[derive(Debug, clap::Parser)]
#[clap(
#[command(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
pub struct Cli {
#[clap(subcommand)]
#[command(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
#[command(flatten)]
pub run: cumulus_client_cli::RunCmd,

/// Disable automatic hardware benchmarks.
Expand All @@ -59,11 +59,11 @@ pub struct Cli {
///
/// The results are then printed out in the logs, and also sent as part of
/// telemetry, if telemetry is enabled.
#[clap(long)]
#[arg(long)]
pub no_hardware_benchmarks: bool,

/// Relay chain arguments
#[clap(raw = true)]
#[arg(raw = true)]
pub relay_chain_args: Vec<String>,
}

Expand Down
2 changes: 1 addition & 1 deletion polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Runs a polkadot parachain node which could be a collator."

[dependencies]
async-trait = "0.1.57"
clap = { version = "3.2.22", features = ["derive", "deprecated"] }
clap = { version = "4.0.9", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
futures = "0.3.24"
hex-literal = "0.3.4"
Expand Down
14 changes: 7 additions & 7 deletions polkadot-parachain/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::path::PathBuf;
#[derive(Debug, clap::Subcommand)]
pub enum Subcommand {
/// Key management CLI utilities
#[clap(subcommand)]
#[command(subcommand)]
Key(sc_cli::KeySubcommand),

/// Build a chain specification.
Expand Down Expand Up @@ -52,24 +52,24 @@ pub enum Subcommand {

/// Sub-commands concerned with benchmarking.
/// The pallet benchmarking moved to the `pallet` sub-command.
#[clap(subcommand)]
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some testing command against a specified runtime state.
TryRuntime(try_runtime_cli::TryRuntimeCmd),
}

#[derive(Debug, clap::Parser)]
#[clap(
#[command(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
pub struct Cli {
#[clap(subcommand)]
#[command(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
#[command(flatten)]
pub run: cumulus_client_cli::RunCmd,

/// Disable automatic hardware benchmarks.
Expand All @@ -79,11 +79,11 @@ pub struct Cli {
///
/// The results are then printed out in the logs, and also sent as part of
/// telemetry, if telemetry is enabled.
#[clap(long)]
#[arg(long)]
pub no_hardware_benchmarks: bool,

/// Relay chain arguments
#[clap(raw = true)]
#[arg(raw = true)]
pub relaychain_args: Vec<String>,
}

Expand Down
2 changes: 1 addition & 1 deletion test/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ path = "src/main.rs"

[dependencies]
async-trait = "0.1.57"
clap = { version = "3.2.22", features = ["derive", "deprecated"] }
clap = { version = "4.0.9", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
criterion = { version = "0.4.0", features = [ "async_tokio" ] }
jsonrpsee = { version = "0.15.1", features = ["server"] }
Expand Down
Loading