deps: update clap and structopt (#3809)

This commit is contained in:
André Silva
2019-10-12 18:31:49 +01:00
committed by GitHub
parent ea3b9bf393
commit 6e5fe1a557
9 changed files with 92 additions and 104 deletions
+45 -67
View File
@@ -17,7 +17,7 @@
use crate::traits::{AugmentClap, GetLogFilter};
use std::path::PathBuf;
use structopt::{StructOpt, clap::{arg_enum, App, AppSettings, _clap_count_exprs, SubCommand, Arg}};
use structopt::{StructOpt, clap::{arg_enum, App, AppSettings, SubCommand, Arg}};
pub use crate::execution_strategy::ExecutionStrategy;
@@ -205,11 +205,9 @@ pub struct NodeKeyParams {
#[structopt(
long = "node-key-type",
value_name = "TYPE",
raw(
possible_values = "&NodeKeyType::variants()",
case_insensitive = "true",
default_value = r#""Ed25519""#
)
possible_values = &NodeKeyType::variants(),
case_insensitive = true,
default_value = "Ed25519"
)]
pub node_key_type: NodeKeyType,
@@ -248,11 +246,9 @@ pub struct ExecutionStrategies {
#[structopt(
long = "execution-syncing",
value_name = "STRATEGY",
raw(
possible_values = "&ExecutionStrategy::variants()",
case_insensitive = "true",
default_value = r#""NativeElseWasm""#
)
possible_values = &ExecutionStrategy::variants(),
case_insensitive = true,
default_value = "NativeElseWasm"
)]
pub execution_syncing: ExecutionStrategy,
@@ -260,11 +256,9 @@ pub struct ExecutionStrategies {
#[structopt(
long = "execution-import-block",
value_name = "STRATEGY",
raw(
possible_values = "&ExecutionStrategy::variants()",
case_insensitive = "true",
default_value = r#""NativeElseWasm""#
)
possible_values = &ExecutionStrategy::variants(),
case_insensitive = true,
default_value = "NativeElseWasm"
)]
pub execution_import_block: ExecutionStrategy,
@@ -272,11 +266,9 @@ pub struct ExecutionStrategies {
#[structopt(
long = "execution-block-construction",
value_name = "STRATEGY",
raw(
possible_values = "&ExecutionStrategy::variants()",
case_insensitive = "true",
default_value = r#""Wasm""#
)
possible_values = &ExecutionStrategy::variants(),
case_insensitive = true,
default_value = "Wasm"
)]
pub execution_block_construction: ExecutionStrategy,
@@ -284,11 +276,9 @@ pub struct ExecutionStrategies {
#[structopt(
long = "execution-offchain-worker",
value_name = "STRATEGY",
raw(
possible_values = "&ExecutionStrategy::variants()",
case_insensitive = "true",
default_value = r#""Native""#
)
possible_values = &ExecutionStrategy::variants(),
case_insensitive = true,
default_value = "Native"
)]
pub execution_offchain_worker: ExecutionStrategy,
@@ -296,11 +286,9 @@ pub struct ExecutionStrategies {
#[structopt(
long = "execution-other",
value_name = "STRATEGY",
raw(
possible_values = "&ExecutionStrategy::variants()",
case_insensitive = "true",
default_value = r#""Native""#
)
possible_values = &ExecutionStrategy::variants(),
case_insensitive = true,
default_value = "Native"
)]
pub execution_other: ExecutionStrategy,
@@ -308,17 +296,15 @@ pub struct ExecutionStrategies {
#[structopt(
long = "execution",
value_name = "STRATEGY",
raw(
possible_values = "&ExecutionStrategy::variants()",
case_insensitive = "true",
conflicts_with_all = "&[
\"execution_other\",
\"execution_offchain_worker\",
\"execution_block_construction\",
\"execution_import_block\",
\"execution_syncing\",
]"
)
possible_values = &ExecutionStrategy::variants(),
case_insensitive = true,
conflicts_with_all = &[
"execution-other",
"execution-offchain-worker",
"execution-block-construction",
"execution-import-block",
"execution-syncing",
]
)]
pub execution: Option<ExecutionStrategy>,
}
@@ -377,7 +363,7 @@ pub struct RunCmd {
/// allow localhost, https://polkadot.js.org and
/// https://substrate-ui.parity.io origins. When running in --dev mode the
/// default is to allow all origins.
#[structopt(long = "rpc-cors", value_name = "ORIGINS", parse(try_from_str = "parse_cors"))]
#[structopt(long = "rpc-cors", value_name = "ORIGINS", parse(try_from_str = parse_cors))]
pub rpc_cors: Option<Cors>,
/// Specify the pruning mode, a number of blocks to keep or 'archive'.
@@ -404,7 +390,7 @@ pub struct RunCmd {
/// telemetry endpoints. Verbosity levels range from 0-9, with 0 denoting
/// the least verbosity. If no verbosity level is specified the default is
/// 0.
#[structopt(long = "telemetry-url", value_name = "URL VERBOSITY", parse(try_from_str = "parse_telemetry_endpoints"))]
#[structopt(long = "telemetry-url", value_name = "URL VERBOSITY", parse(try_from_str = parse_telemetry_endpoints))]
pub telemetry_endpoints: Vec<(String, u8)>,
/// Should execute offchain workers on every block.
@@ -413,11 +399,9 @@ pub struct RunCmd {
#[structopt(
long = "offchain-worker",
value_name = "ENABLED",
raw(
possible_values = "&OffchainWorkerEnabled::variants()",
case_insensitive = "true",
default_value = r#""WhenValidating""#
)
possible_values = &OffchainWorkerEnabled::variants(),
case_insensitive = true,
default_value = "WhenValidating"
)]
pub offchain_worker: OffchainWorkerEnabled,
@@ -425,11 +409,9 @@ pub struct RunCmd {
#[structopt(
long = "wasm-execution",
value_name = "METHOD",
raw(
possible_values = "&WasmExecutionMethod::variants()",
case_insensitive = "true",
default_value = r#""Interpreted""#
)
possible_values = &WasmExecutionMethod::variants(),
case_insensitive = true,
default_value = "Interpreted"
)]
pub wasm_method: WasmExecutionMethod,
@@ -464,14 +446,14 @@ pub struct RunCmd {
/// Use interactive shell for entering the password used by the keystore.
#[structopt(
long = "password-interactive",
raw(conflicts_with_all = "&[ \"password\", \"password_filename\" ]")
conflicts_with_all = &[ "password", "password-filename" ]
)]
pub password_interactive: bool,
/// Password used by the keystore.
#[structopt(
long = "password",
raw(conflicts_with_all = "&[ \"password_interactive\", \"password_filename\" ]")
conflicts_with_all = &[ "password-interactive", "password-filename" ]
)]
pub password: Option<String>,
@@ -480,7 +462,7 @@ pub struct RunCmd {
long = "password-filename",
value_name = "PATH",
parse(from_os_str),
raw(conflicts_with_all = "&[ \"password_interactive\", \"password\" ]")
conflicts_with_all = &[ "password-interactive", "password" ]
)]
pub password_filename: Option<PathBuf>
}
@@ -684,11 +666,9 @@ pub struct ImportBlocksCmd {
#[structopt(
long = "wasm-execution",
value_name = "METHOD",
raw(
possible_values = "&WasmExecutionMethod::variants()",
case_insensitive = "true",
default_value = r#""Interpreted""#
)
possible_values = &WasmExecutionMethod::variants(),
case_insensitive = true,
default_value = "Interpreted"
)]
pub wasm_method: WasmExecutionMethod,
@@ -696,11 +676,9 @@ pub struct ImportBlocksCmd {
#[structopt(
long = "execution",
value_name = "STRATEGY",
raw(
possible_values = "&ExecutionStrategy::variants()",
case_insensitive = "true",
default_value = r#""NativeElseWasm""#
)
possible_values = &ExecutionStrategy::variants(),
case_insensitive = true,
default_value = "NativeElseWasm"
)]
pub execution: ExecutionStrategy,
}