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:
Qinxuan Chen
2022-01-25 00:28:46 +08:00
committed by GitHub
parent d1ff02d31e
commit e327b734bc
66 changed files with 660 additions and 768 deletions
@@ -17,6 +17,7 @@
//! Implementation of the `palletid` subcommand
use clap::Parser;
use frame_support::PalletId;
use sc_cli::{
utils::print_from_uri, with_crypto_scheme, CryptoSchemeFlag, Error, KeystoreParams,
@@ -24,35 +25,34 @@ use sc_cli::{
};
use sp_core::crypto::{unwrap_or_default_ss58_version, Ss58AddressFormat, Ss58Codec};
use sp_runtime::traits::AccountIdConversion;
use structopt::StructOpt;
/// The `palletid` command
#[derive(Debug, StructOpt)]
#[structopt(name = "palletid", about = "Inspect a module ID address")]
#[derive(Debug, Parser)]
#[clap(name = "palletid", about = "Inspect a module ID address")]
pub struct PalletIdCmd {
/// The module ID used to derive the account
id: String,
/// network address format
#[structopt(
#[clap(
long,
value_name = "NETWORK",
possible_values = &Ss58AddressFormat::all_names()[..],
parse(try_from_str = Ss58AddressFormat::try_from),
case_insensitive = true,
ignore_case = true,
)]
pub network: Option<Ss58AddressFormat>,
#[allow(missing_docs)]
#[structopt(flatten)]
#[clap(flatten)]
pub output_scheme: OutputTypeFlag,
#[allow(missing_docs)]
#[structopt(flatten)]
#[clap(flatten)]
pub crypto_scheme: CryptoSchemeFlag,
#[allow(missing_docs)]
#[structopt(flatten)]
#[clap(flatten)]
pub keystore_params: KeystoreParams,
}