Update clap to version 4 (#6128)

* Move clap to 4.0.9

* Remove "deprecated" feature flag

* Convert to default_value_t

* update lockfile for {"substrate"}

* Add group(skip) to avoid naming conflict

* More group(skip)

Co-authored-by: parity-processbot <>
This commit is contained in:
Sebastian Kunert
2022-10-18 11:02:41 +02:00
committed by GitHub
parent 7339fb92f2
commit 99f705537b
17 changed files with 405 additions and 728 deletions
@@ -17,6 +17,6 @@ sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
clap = { version = "3.1", features = ["derive"] }
clap = { version = "4.0.9", features = ["derive"] }
log = "0.4.17"
tokio = { version = "1.19.2", features = ["macros"] }
@@ -16,18 +16,18 @@
//! Remote tests for bags-list pallet.
use clap::{ArgEnum, Parser};
use clap::{Parser, ValueEnum};
#[derive(Clone, Debug, ArgEnum)]
#[clap(rename_all = "PascalCase")]
#[derive(Clone, Debug, ValueEnum)]
#[value(rename_all = "PascalCase")]
enum Command {
CheckMigration,
SanityCheck,
Snapshot,
}
#[derive(Clone, Debug, ArgEnum)]
#[clap(rename_all = "PascalCase")]
#[derive(Clone, Debug, ValueEnum)]
#[value(rename_all = "PascalCase")]
enum Runtime {
Polkadot,
Kusama,
@@ -36,13 +36,13 @@ enum Runtime {
#[derive(Parser)]
struct Cli {
#[clap(long, short, default_value = "wss://kusama-rpc.polkadot.io:443")]
#[arg(long, short, default_value = "wss://kusama-rpc.polkadot.io:443")]
uri: String,
#[clap(long, short, ignore_case = true, arg_enum, default_value = "kusama")]
#[arg(long, short, ignore_case = true, value_enum, default_value_t = Runtime::Kusama)]
runtime: Runtime,
#[clap(long, short, ignore_case = true, arg_enum, default_value = "SanityCheck")]
#[arg(long, short, ignore_case = true, value_enum, default_value_t = Command::SanityCheck)]
command: Command,
#[clap(long, short)]
#[arg(long, short)]
snapshot_limit: Option<usize>,
}