mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57: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:
@@ -17,30 +17,31 @@
|
||||
|
||||
//! Make the set of bag thresholds to be used with pallet-bags-list.
|
||||
|
||||
use clap::Parser;
|
||||
use generate_bags::generate_thresholds;
|
||||
use std::path::PathBuf;
|
||||
use structopt::StructOpt;
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[derive(Debug, Parser)]
|
||||
// #[clap(author, version, about)]
|
||||
struct Opt {
|
||||
/// How many bags to generate.
|
||||
#[structopt(long, default_value = "200")]
|
||||
#[clap(long, default_value = "200")]
|
||||
n_bags: usize,
|
||||
|
||||
/// Where to write the output.
|
||||
output: PathBuf,
|
||||
|
||||
/// The total issuance of the currency used to create `VoteWeight`.
|
||||
#[structopt(short, long)]
|
||||
#[clap(short, long)]
|
||||
total_issuance: u128,
|
||||
|
||||
/// The minimum account balance (i.e. existential deposit) for the currency used to create
|
||||
/// `VoteWeight`.
|
||||
#[structopt(short, long)]
|
||||
#[clap(short, long)]
|
||||
minimum_balance: u128,
|
||||
}
|
||||
|
||||
fn main() -> Result<(), std::io::Error> {
|
||||
let Opt { n_bags, output, total_issuance, minimum_balance } = Opt::from_args();
|
||||
let Opt { n_bags, output, total_issuance, minimum_balance } = Opt::parse();
|
||||
generate_thresholds::<node_runtime::Runtime>(n_bags, &output, total_issuance, minimum_balance)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user