mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +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:
@@ -11,6 +11,7 @@ repository = "https://github.com/paritytech/substrate/"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "3.0", features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0" }
|
||||
derive_more = "0.99"
|
||||
sc-cli = { version = "0.10.0-dev", path = "../../../client/cli" }
|
||||
@@ -20,4 +21,3 @@ sc-service = { version = "0.10.0-dev", default-features = false, path = "../../.
|
||||
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
|
||||
sp-core = { version = "4.1.0-dev", path = "../../../primitives/core" }
|
||||
sp-runtime = { version = "4.1.0-dev", path = "../../../primitives/runtime" }
|
||||
structopt = "0.3.8"
|
||||
|
||||
@@ -19,27 +19,25 @@
|
||||
//! Structs to easily compose inspect sub-command for CLI.
|
||||
|
||||
use sc_cli::{ImportParams, SharedParams};
|
||||
use std::fmt::Debug;
|
||||
use structopt::StructOpt;
|
||||
|
||||
/// The `inspect` command used to print decoded chain data.
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[derive(Debug, clap::Parser)]
|
||||
pub struct InspectCmd {
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(flatten)]
|
||||
#[clap(subcommand)]
|
||||
pub command: InspectSubCmd,
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(flatten)]
|
||||
#[clap(flatten)]
|
||||
pub shared_params: SharedParams,
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(flatten)]
|
||||
#[clap(flatten)]
|
||||
pub import_params: ImportParams,
|
||||
}
|
||||
|
||||
/// A possible inspect sub-commands.
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[derive(Debug, clap::Subcommand)]
|
||||
pub enum InspectSubCmd {
|
||||
/// Decode block with native version of runtime and print out the details.
|
||||
Block {
|
||||
@@ -48,7 +46,7 @@ pub enum InspectSubCmd {
|
||||
/// Can be either a block hash (no 0x prefix) or a number to retrieve existing block,
|
||||
/// or a 0x-prefixed bytes hex string, representing SCALE encoding of
|
||||
/// a block.
|
||||
#[structopt(value_name = "HASH or NUMBER or BYTES")]
|
||||
#[clap(value_name = "HASH or NUMBER or BYTES")]
|
||||
input: String,
|
||||
},
|
||||
/// Decode extrinsic with native version of runtime and print out the details.
|
||||
@@ -58,7 +56,7 @@ pub enum InspectSubCmd {
|
||||
/// Can be either a block hash (no 0x prefix) or number and the index, in the form
|
||||
/// of `{block}:{index}` or a 0x-prefixed bytes hex string,
|
||||
/// representing SCALE encoding of an extrinsic.
|
||||
#[structopt(value_name = "BLOCK:INDEX or BYTES")]
|
||||
#[clap(value_name = "BLOCK:INDEX or BYTES")]
|
||||
input: String,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user