mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
use clap3 instead of structopt (#10632)
* use clap3 instead of structopt Signed-off-by: koushiro <koushiro.cqx@gmail.com> * format Signed-off-by: koushiro <koushiro.cqx@gmail.com> * update ss58-registry and revert some nits Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix clippy and doc Signed-off-by: koushiro <koushiro.cqx@gmail.com> * update clap to 3.0.7 Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Apply review suggestions Signed-off-by: koushiro <koushiro.cqx@gmail.com> * remove useless option long name Signed-off-by: koushiro <koushiro.cqx@gmail.com> * cargo fmt Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -26,25 +26,25 @@ use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor};
|
||||
use std::{fmt::Debug, str::FromStr};
|
||||
|
||||
/// Configurations of the [`Command::ExecuteBlock`].
|
||||
#[derive(Debug, Clone, structopt::StructOpt)]
|
||||
#[derive(Debug, Clone, clap::Parser)]
|
||||
pub struct ExecuteBlockCmd {
|
||||
/// Overwrite the wasm code in state or not.
|
||||
#[structopt(long)]
|
||||
#[clap(long)]
|
||||
overwrite_wasm_code: bool,
|
||||
|
||||
/// If set, then the state root check is disabled by the virtue of calling into
|
||||
/// `TryRuntime_execute_block_no_check` instead of
|
||||
/// `Core_execute_block`.
|
||||
#[structopt(long)]
|
||||
#[clap(long)]
|
||||
no_check: bool,
|
||||
|
||||
/// The block hash at which to fetch the block.
|
||||
///
|
||||
/// If the `live` state type is being used, then this can be omitted, and is equal to whatever
|
||||
/// the `state::at` is. Only use this (with care) when combined with a snapshot.
|
||||
#[structopt(
|
||||
#[clap(
|
||||
long,
|
||||
multiple = false,
|
||||
multiple_values = false,
|
||||
parse(try_from_str = crate::parse::hash)
|
||||
)]
|
||||
block_at: Option<String>,
|
||||
@@ -53,9 +53,9 @@ pub struct ExecuteBlockCmd {
|
||||
///
|
||||
/// If the `live` state type is being used, then this can be omitted, and is equal to whatever
|
||||
/// the `state::uri` is. Only use this (with care) when combined with a snapshot.
|
||||
#[structopt(
|
||||
#[clap(
|
||||
long,
|
||||
multiple = false,
|
||||
multiple_values = false,
|
||||
parse(try_from_str = crate::parse::url)
|
||||
)]
|
||||
block_ws_uri: Option<String>,
|
||||
@@ -65,7 +65,7 @@ pub struct ExecuteBlockCmd {
|
||||
/// For this command only, if the `live` is used, then state of the parent block is fetched.
|
||||
///
|
||||
/// If `block_at` is provided, then the [`State::Live::at`] is being ignored.
|
||||
#[structopt(subcommand)]
|
||||
#[clap(subcommand)]
|
||||
state: State,
|
||||
}
|
||||
|
||||
|
||||
@@ -35,14 +35,10 @@ const SUB: &'static str = "chain_subscribeFinalizedHeads";
|
||||
const UN_SUB: &'static str = "chain_unsubscribeFinalizedHeads";
|
||||
|
||||
/// Configurations of the [`Command::FollowChain`].
|
||||
#[derive(Debug, Clone, structopt::StructOpt)]
|
||||
#[derive(Debug, Clone, clap::Parser)]
|
||||
pub struct FollowChainCmd {
|
||||
/// The url to connect to.
|
||||
#[structopt(
|
||||
short,
|
||||
long,
|
||||
parse(try_from_str = parse::url),
|
||||
)]
|
||||
#[clap(short, long, parse(try_from_str = parse::url))]
|
||||
uri: String,
|
||||
}
|
||||
|
||||
|
||||
@@ -28,19 +28,19 @@ use sp_runtime::traits::{Block as BlockT, Header, NumberFor};
|
||||
use std::{fmt::Debug, str::FromStr};
|
||||
|
||||
/// Configurations of the [`Command::OffchainWorker`].
|
||||
#[derive(Debug, Clone, structopt::StructOpt)]
|
||||
#[derive(Debug, Clone, clap::Parser)]
|
||||
pub struct OffchainWorkerCmd {
|
||||
/// Overwrite the wasm code in state or not.
|
||||
#[structopt(long)]
|
||||
#[clap(long)]
|
||||
overwrite_wasm_code: bool,
|
||||
|
||||
/// The block hash at which to fetch the header.
|
||||
///
|
||||
/// If the `live` state type is being used, then this can be omitted, and is equal to whatever
|
||||
/// the `state::at` is. Only use this (with care) when combined with a snapshot.
|
||||
#[structopt(
|
||||
#[clap(
|
||||
long,
|
||||
multiple = false,
|
||||
multiple_values = false,
|
||||
parse(try_from_str = parse::hash)
|
||||
)]
|
||||
header_at: Option<String>,
|
||||
@@ -49,15 +49,15 @@ pub struct OffchainWorkerCmd {
|
||||
///
|
||||
/// If the `live` state type is being used, then this can be omitted, and is equal to whatever
|
||||
/// the `state::uri` is. Only use this (with care) when combined with a snapshot.
|
||||
#[structopt(
|
||||
#[clap(
|
||||
long,
|
||||
multiple = false,
|
||||
multiple_values = false,
|
||||
parse(try_from_str = parse::url)
|
||||
)]
|
||||
header_ws_uri: Option<String>,
|
||||
|
||||
/// The state type to use.
|
||||
#[structopt(subcommand)]
|
||||
#[clap(subcommand)]
|
||||
pub state: State,
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ use crate::{
|
||||
};
|
||||
|
||||
/// Configurations of the [`Command::OnRuntimeUpgrade`].
|
||||
#[derive(Debug, Clone, structopt::StructOpt)]
|
||||
#[derive(Debug, Clone, clap::Parser)]
|
||||
pub struct OnRuntimeUpgradeCmd {
|
||||
/// The state type to use.
|
||||
#[structopt(subcommand)]
|
||||
#[clap(subcommand)]
|
||||
pub state: State,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user