diff --git a/Cargo.lock b/Cargo.lock index a07c38972a..31cf0fe764 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1084,16 +1084,16 @@ dependencies = [ [[package]] name = "clap" -version = "3.1.18" +version = "3.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" +checksum = "d53da17d37dba964b9b3ecb5c5a1f193a2762c700e6829201e645b9381c99dc7" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", "indexmap", - "lazy_static", + "once_cell", "strsim", "termcolor", "textwrap 0.15.0", @@ -1101,9 +1101,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.18" +version = "3.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" +checksum = "c11d40217d16aee8508cc8e5fde8b4ff24639758608e5374e731b53f85749fb9" dependencies = [ "heck 0.4.0", "proc-macro-error", @@ -1114,9 +1114,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +checksum = "5538cd660450ebeb4234cfecf8f2284b844ffc4c50531e66d584ad5b91293613" dependencies = [ "os_str_bytes", ] @@ -1574,7 +1574,7 @@ dependencies = [ name = "cumulus-client-cli" version = "0.1.0" dependencies = [ - "clap 3.1.18", + "clap 3.2.5", "sc-cli", "sc-service", "url", @@ -2182,7 +2182,7 @@ name = "cumulus-test-service" version = "0.1.0" dependencies = [ "async-trait", - "clap 3.1.18", + "clap 3.2.5", "criterion", "cumulus-client-cli", "cumulus-client-consensus-common", @@ -2852,7 +2852,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#c950f18507d2 dependencies = [ "Inflector", "chrono", - "clap 3.1.18", + "clap 3.2.5", "comfy-table", "frame-benchmarking", "frame-support", @@ -5325,9 +5325,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "oorandom" @@ -6499,7 +6499,7 @@ dependencies = [ name = "parachain-template-node" version = "0.1.0" dependencies = [ - "clap 3.1.18", + "clap 3.2.5", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -7057,7 +7057,7 @@ name = "polkadot-cli" version = "0.9.23" source = "git+https://github.com/paritytech/polkadot?branch=master#f57d7f1f2962fd096b49c242c8fff5538dbbe402" dependencies = [ - "clap 3.1.18", + "clap 3.2.5", "frame-benchmarking-cli", "futures 0.3.21", "log", @@ -7703,7 +7703,7 @@ version = "0.9.220" dependencies = [ "assert_cmd", "async-trait", - "clap 3.1.18", + "clap 3.2.5", "contracts-rococo-runtime", "cumulus-client-cli", "cumulus-client-consensus-aura", @@ -9351,7 +9351,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#c950f18507d2b4a1d353c359ee3949f1b355bc60" dependencies = [ "chrono", - "clap 3.1.18", + "clap 3.2.5", "fdlimit", "futures 0.3.21", "hex", @@ -12386,7 +12386,7 @@ name = "try-runtime-cli" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#c950f18507d2b4a1d353c359ee3949f1b355bc60" dependencies = [ - "clap 3.1.18", + "clap 3.2.5", "jsonrpsee", "log", "parity-scale-codec", @@ -12418,7 +12418,7 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.3", "rand 0.8.5", "static_assertions", diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index f9ea950d17..4a95429e16 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -clap = { version = "3.1", features = ["derive"] } +clap = { version = "3.2.5", features = ["derive", "deprecated"] } # Substrate sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 3e541f98bd..dae8b52593 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -119,11 +119,11 @@ impl sc_cli::CliConfiguration for PurgeChainCmd { } } -fn validate_relay_chain_url(arg: &str) -> Result<(), String> { +fn validate_relay_chain_url(arg: &str) -> Result { let url = Url::parse(arg).map_err(|e| e.to_string())?; if url.scheme() == "ws" { - Ok(()) + Ok(url) } else { Err(format!( "'{}' URL scheme not supported. Only websocket RPC is currently supported", @@ -148,8 +148,7 @@ pub struct RunCmd { /// EXPERIMENTAL: Specify an URL to a relay chain full node to communicate with. #[clap( long, - parse(try_from_str), - validator = validate_relay_chain_url, + value_parser = validate_relay_chain_url, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "one", "two"] ) ] pub relay_chain_rpc_url: Option, diff --git a/parachain-template/node/Cargo.toml b/parachain-template/node/Cargo.toml index 6ee398d132..a389328994 100644 --- a/parachain-template/node/Cargo.toml +++ b/parachain-template/node/Cargo.toml @@ -14,7 +14,7 @@ name = "parachain-collator" path = "src/main.rs" [dependencies] -clap = { version = "3.1", features = ["derive"] } +clap = { version = "3.2.5", features = ["derive"] } derive_more = "0.99.2" log = "0.4.17" codec = { package = "parity-scale-codec", version = "3.0.0" } diff --git a/parachain-template/node/src/cli.rs b/parachain-template/node/src/cli.rs index 0d36120a47..2b28e4ce80 100644 --- a/parachain-template/node/src/cli.rs +++ b/parachain-template/node/src/cli.rs @@ -47,7 +47,7 @@ pub enum Subcommand { #[derive(Debug, Parser)] pub struct ExportGenesisStateCommand { /// Output file name or stdout if unspecified. - #[clap(parse(from_os_str))] + #[clap(action)] pub output: Option, /// Write output in binary. Default is to write in hex. @@ -63,15 +63,15 @@ pub struct ExportGenesisStateCommand { #[derive(Debug, Parser)] pub struct ExportGenesisWasmCommand { /// Output file name or stdout if unspecified. - #[clap(parse(from_os_str))] + #[clap(action)] pub output: Option, /// Write output in binary. Default is to write in hex. - #[clap(short, long)] + #[clap(short, long, action)] pub raw: bool, /// The name of the chain for that the genesis wasm file should be exported. - #[clap(long)] + #[clap(long, action)] pub chain: Option, } diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index 4c2224821c..8b461ba6ce 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -12,7 +12,7 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.56" -clap = { version = "3.1", features = ["derive"] } +clap = { version = "3.2.5", features = ["derive", "deprecated"] } codec = { package = "parity-scale-codec", version = "3.0.0" } futures = { version = "0.3.1", features = ["compat"] } hex-literal = "0.3.4" diff --git a/polkadot-parachain/src/cli.rs b/polkadot-parachain/src/cli.rs index 31ecb8a5aa..b215a27a83 100644 --- a/polkadot-parachain/src/cli.rs +++ b/polkadot-parachain/src/cli.rs @@ -68,7 +68,7 @@ pub enum Subcommand { #[derive(Debug, Parser)] pub struct ExportGenesisStateCommand { /// Output file name or stdout if unspecified. - #[clap(parse(from_os_str))] + #[clap(action)] pub output: Option, /// Write output in binary. Default is to write in hex. @@ -84,7 +84,7 @@ pub struct ExportGenesisStateCommand { #[derive(Debug, Parser)] pub struct ExportGenesisWasmCommand { /// Output file name or stdout if unspecified. - #[clap(parse(from_os_str))] + #[clap(action)] pub output: Option, /// Write output in binary. Default is to write in hex. diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index a51df91b2d..d83f6b8a36 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -47,7 +47,7 @@ sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "mast sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } -clap = { version = "3.1", features = ["derive"] } +clap = { version = "3.2.5", features = ["derive", "deprecated"] } tracing = "0.1.25" # Polkadot diff --git a/test/service/src/cli.rs b/test/service/src/cli.rs index 13995d6ed3..14c7a3a8af 100644 --- a/test/service/src/cli.rs +++ b/test/service/src/cli.rs @@ -29,34 +29,34 @@ pub struct ExportGenesisStateCommand { pub parachain_id: u32, /// Output file name or stdout if unspecified. - #[clap(parse(from_os_str))] + #[clap(action)] pub output: Option, /// Write output in binary. Default is to write in hex. - #[clap(short, long)] + #[clap(short, long, action)] pub raw: bool, /// The name of the chain for that the genesis state should be exported. - #[clap(long)] + #[clap(long, action)] pub chain: Option, } /// Command for exporting the genesis wasm file. #[derive(Debug, Parser)] pub struct ExportGenesisWasmCommand { - #[clap(default_value_t = 2000u32)] + #[clap(default_value_t = 2000u32, action)] pub parachain_id: u32, /// Output file name or stdout if unspecified. - #[clap(parse(from_os_str))] + #[clap(action)] pub output: Option, /// Write output in binary. Default is to write in hex. - #[clap(short, long)] + #[clap(short, long, action)] pub raw: bool, /// The name of the chain for that the genesis wasm file should be exported. - #[clap(long)] + #[clap(long, action)] pub chain: Option, } #[derive(Subcommand, Debug)]