Skip to content

Commit

Permalink
Update clap to the latest version (#11017)
Browse files Browse the repository at this point in the history
* Update clap to the latest version

Besides that it also removes some `structopt` leftovers from some docs.

* Fix compile errors

* More fixes
  • Loading branch information
bkchr authored Mar 12, 2022
1 parent 5cc2ef8 commit 89fcb3e
Show file tree
Hide file tree
Showing 19 changed files with 87 additions and 86 deletions.
40 changes: 20 additions & 20 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 bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"]
name = "node-template"

[dependencies]
clap = { version = "3.0", features = ["derive"] }
clap = { version = "3.1.6", features = ["derive"] }

sc-cli = { version = "0.10.0-dev", path = "../../../client/cli", features = ["wasmtime"] }
sp-core = { version = "6.0.0", path = "../../../primitives/core" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "3.0", features = ["derive"] }
clap = { version = "3.1.6", features = ["derive"] }
log = "0.4.8"
node-primitives = { version = "2.0.0", path = "../primitives" }
node-testing = { version = "3.0.0-dev", path = "../testing" }
Expand Down
4 changes: 2 additions & 2 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
# third-party dependencies
clap = { version = "3.0", features = ["derive"], optional = true }
clap = { version = "3.1.6", features = ["derive"], optional = true }
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.136", features = ["derive"] }
futures = "0.3.19"
Expand Down Expand Up @@ -133,7 +133,7 @@ remote-externalities = { path = "../../../utils/frame/remote-externalities" }
pallet-timestamp = { version = "4.0.0-dev", path = "../../../frame/timestamp" }

[build-dependencies]
clap = { version = "3.0", optional = true }
clap = { version = "3.1.6", optional = true }
clap_complete = { version = "3.0", optional = true }
node-inspect = { version = "0.9.0-dev", optional = true, path = "../inspect" }
frame-benchmarking-cli = { version = "4.0.0-dev", optional = true, path = "../../../utils/frame/benchmarking-cli" }
Expand Down
4 changes: 2 additions & 2 deletions bin/node/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() {
mod cli {
include!("src/cli.rs");

use clap::{ArgEnum, IntoApp};
use clap::{ArgEnum, CommandFactory};
use clap_complete::{generate_to, Shell};
use std::{env, fs, path::Path};
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
Expand Down Expand Up @@ -61,6 +61,6 @@ mod cli {

fs::create_dir(&path).ok();

let _ = generate_to(*shell, &mut Cli::into_app(), "substrate-node", &path);
let _ = generate_to(*shell, &mut Cli::command(), "substrate-node", &path);
}
}
2 changes: 1 addition & 1 deletion bin/node/inspect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/paritytech/substrate/"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
clap = { version = "3.0", features = ["derive"] }
clap = { version = "3.1.6", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
thiserror = "1.0"
sc-cli = { version = "0.10.0-dev", path = "../../../client/cli" }
Expand Down
2 changes: 1 addition & 1 deletion bin/utils/chain-spec-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
ansi_term = "0.12.1"
clap = { version = "3.0", features = ["derive"] }
clap = { version = "3.1.6", features = ["derive"] }
rand = "0.8"

sc-keystore = { version = "4.0.0-dev", path = "../../../client/keystore" }
Expand Down
2 changes: 1 addition & 1 deletion bin/utils/subkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ path = "src/main.rs"
name = "subkey"

[dependencies]
clap = { version = "3.0", features = ["derive"] }
clap = { version = "3.1.6", features = ["derive"] }
sc-cli = { version = "0.10.0-dev", path = "../../../client/cli" }
2 changes: 1 addition & 1 deletion client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
chrono = "0.4.10"
clap = { version = "3.0", features = ["derive"] }
clap = { version = "3.1.6", features = ["derive"] }
fdlimit = "0.2.1"
futures = "0.3.19"
hex = "0.4.2"
Expand Down
8 changes: 8 additions & 0 deletions client/cli/src/arg_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ impl Into<sc_service::config::WasmExecutionMethod> for WasmExecutionMethod {
}
}

/// The default [`WasmExecutionMethod`].
#[cfg(feature = "wasmtime")]
pub const DEFAULT_WASM_EXECUTION_METHOD: &str = "Compiled";

/// The default [`WasmExecutionMethod`].
#[cfg(not(feature = "wasmtime"))]
pub const DEFAULT_WASM_EXECUTION_METHOD: &str = "interpreted-i-know-what-i-do";

#[allow(missing_docs)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, ArgEnum)]
#[clap(rename_all = "PascalCase")]
Expand Down
Loading

0 comments on commit 89fcb3e

Please sign in to comment.