Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Change to use the same subcommand syntax as subkey (#8678)
Browse files Browse the repository at this point in the history
* Change to use the same subcommand syntax as subkey

* Update client/cli/src/commands/inspect_key.rs

* revert to InspectKeyCmd struct
  • Loading branch information
nuke-web3 authored May 4, 2021
1 parent 5f73ba1 commit b094eda
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bin/node/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub enum Subcommand {
name = "inspect",
about = "Decode given block or extrinsic using current native runtime."
)]
Inspect(node_inspect::cli::InspectCmd),
Inspect(node_inspect::cli::InspectKeyCmd),

/// The custom benchmark subcommmand benchmarking runtime pallets.
#[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
Expand Down
2 changes: 1 addition & 1 deletion bin/node/inspect/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use structopt::StructOpt;

/// The `inspect` command used to print decoded chain data.
#[derive(Debug, StructOpt)]
pub struct InspectCmd {
pub struct InspectKeyCmd {
#[allow(missing_docs)]
#[structopt(flatten)]
pub command: InspectSubCmd,
Expand Down
6 changes: 3 additions & 3 deletions bin/node/inspect/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

//! Command ran by the CLI

use crate::cli::{InspectCmd, InspectSubCmd};
use crate::cli::{InspectKeyCmd, InspectSubCmd};
use crate::Inspector;
use sc_cli::{CliConfiguration, ImportParams, Result, SharedParams};
use sc_service::{new_full_client, Configuration, NativeExecutionDispatch};
use sp_runtime::traits::Block;
use std::str::FromStr;

impl InspectCmd {
impl InspectKeyCmd {
/// Run the inspect command, passing the inspector.
pub fn run<B, RA, EX>(&self, config: Configuration) -> Result<()>
where
Expand Down Expand Up @@ -54,7 +54,7 @@ impl InspectCmd {
}
}

impl CliConfiguration for InspectCmd {
impl CliConfiguration for InspectKeyCmd {
fn shared_params(&self) -> &SharedParams {
&self.shared_params
}
Expand Down
2 changes: 1 addition & 1 deletion client/cli/src/commands/inspect_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use structopt::StructOpt;
/// The `inspect` command
#[derive(Debug, StructOpt)]
#[structopt(
name = "inspect-key",
name = "inspect",
about = "Gets a public key and a SS58 address from the provided Secret URI"
)]
pub struct InspectKeyCmd {
Expand Down
4 changes: 2 additions & 2 deletions client/cli/src/commands/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum KeySubcommand {
Generate(GenerateCmd),

/// Gets a public key and a SS58 address from the provided Secret URI
InspectKey(InspectKeyCmd),
Inspect(InspectKeyCmd),

/// Print the peer ID corresponding to the node key in the given file
InspectNodeKey(InspectNodeKeyCmd),
Expand All @@ -54,7 +54,7 @@ impl KeySubcommand {
match self {
KeySubcommand::GenerateNodeKey(cmd) => cmd.run(),
KeySubcommand::Generate(cmd) => cmd.run(),
KeySubcommand::InspectKey(cmd) => cmd.run(),
KeySubcommand::Inspect(cmd) => cmd.run(),
KeySubcommand::Insert(cmd) => cmd.run(cli),
KeySubcommand::InspectNodeKey(cmd) => cmd.run(),
}
Expand Down

0 comments on commit b094eda

Please sign in to comment.