Update clap to version 4 (#1745)

* Bump to clap4

* Adjust to clap 4 style

* Remove two more deprecated occurences of clap macro

* Remove "deprecated" feature from clap

* Update cargo lock

* Fix group name

* More skipped group names
This commit is contained in:
Sebastian Kunert
2022-10-18 13:30:22 +02:00
committed by GitHub
parent 00626c0183
commit e960589cf9
9 changed files with 465 additions and 749 deletions
+14 -12
View File
@@ -40,17 +40,18 @@ use url::Url;
/// The `purge-chain` command used to remove the whole chain: the parachain and the relay chain.
#[derive(Debug, clap::Parser)]
#[group(skip)]
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,
}
@@ -131,15 +132,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,
}
@@ -214,15 +215,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,
}
@@ -277,19 +278,20 @@ fn validate_relay_chain_url(arg: &str) -> Result<Url, String> {
/// The `run` command used to run a node.
#[derive(Debug, clap::Parser)]
#[group(skip)]
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
)]