mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +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:
@@ -25,7 +25,8 @@ fn main() {
|
||||
mod cli {
|
||||
include!("src/cli.rs");
|
||||
|
||||
use sc_cli::structopt::clap::Shell;
|
||||
use clap::{ArgEnum, IntoApp};
|
||||
use clap_complete::{generate_to, Shell};
|
||||
use std::{env, fs, path::Path};
|
||||
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
|
||||
|
||||
@@ -37,9 +38,8 @@ mod cli {
|
||||
}
|
||||
|
||||
/// Build shell completion scripts for all known shells
|
||||
/// Full list in https://github.com/kbknapp/clap-rs/blob/e9d0562a1dc5dfe731ed7c767e6cee0af08f0cf9/src/app/parser.rs#L123
|
||||
fn build_shell_completion() {
|
||||
for shell in &[Shell::Bash, Shell::Fish, Shell::Zsh, Shell::Elvish, Shell::PowerShell] {
|
||||
for shell in Shell::value_variants() {
|
||||
build_completion(shell);
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,6 @@ mod cli {
|
||||
|
||||
fs::create_dir(&path).ok();
|
||||
|
||||
Cli::clap().gen_completions("substrate-node", *shell, &path);
|
||||
let _ = generate_to(*shell, &mut Cli::into_app(), "substrate-node", &path);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user