ghost-node/utils/ghostkey/src/lib.rs
Uncle Stretch e21ac88235
rustfmt ghostkey and fix typos
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2025-07-29 14:27:53 +03:00

31 lines
896 B
Rust

use clap::Parser;
use ghost_client_cli::{KeySubcommand, VanityCmd};
#[derive(Debug, Parser)]
#[command(name = "ghostkey", author = "f4t50", about = "Ghost Key Tool", version)]
pub enum Ghostkey {
/// Key utility for the CLI
#[clap(flatten)]
KeyCli(KeySubcommand),
/// Sign a message, with a given (secret) key.
Sign(sc_cli::SignCmd),
/// Generate a seed that provides a vanity address/
Vanity(VanityCmd),
/// Verify a signature for a mesage, provided on STDIN, with a given
/// (public or secret) key.
Verify(sc_cli::VerifyCmd),
}
/// Run the ghostkey command, given the appropriate runtime.
pub fn run() -> Result<(), sc_cli::Error> {
match Ghostkey::parse() {
Ghostkey::KeyCli(cmd) => cmd.run(cli),
Ghostkey::Sign(cmd) => cmd.run(),
Ghostkey::Vanity(cmd) => cmd.run(),
Ghostkey::Verify(cmd) => cmd.run(),
}
}