diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2022-01-14 09:46:57 +0100 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2022-01-14 09:46:57 +0100 |
| commit | a3c2005b0b57ba66d612dea7281ae95c1ad445c4 (patch) | |
| tree | ba5cdca434c10eb9941f1cc370544b5235d9bd14 /src/main.rs | |
| parent | 22ccb7895637e041c17a76eb96c54f16a00e182d (diff) | |
migrate to clap
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs index 211cfb1..2c80f57 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,33 +1,33 @@ mod cmd; +use clap::Parser; use std::process; -use structopt::StructOpt; #[allow(clippy::large_enum_variant)] -#[derive(Debug, StructOpt)] -#[structopt( +#[derive(Debug, Parser)] +#[clap( name = "hdwallet", about = "Hierarchical deterministic wallet for Ethereum" )] enum Options { - #[structopt(about = "Print account public address")] + #[clap(about = "Print account public address")] Address(cmd::address::Options), - #[structopt(about = "Export a private key")] + #[clap(about = "Export a private key")] Export(cmd::export::Options), - #[structopt(about = "Keccak256 hash data")] + #[clap(about = "Keccak256 hash data")] Hash(cmd::hash::Options), - #[structopt(about = "Hex encoding and decoding")] + #[clap(about = "Hex encoding and decoding")] Hex(cmd::hex::Options), - #[structopt(about = "Generate a new HD wallet mnemonic")] + #[clap(about = "Generate a new HD wallet mnemonic")] New(cmd::new::Options), - #[structopt(about = "Export the public key for an account")] + #[clap(about = "Export the public key for an account")] PublicKey(cmd::public_key::Options), - #[structopt(about = "Sign a message")] + #[clap(about = "Sign a message")] Sign(cmd::sign::Options), } fn main() { - if let Err(err) = match Options::from_args() { + if let Err(err) = match Options::parse() { Options::Address(options) => cmd::address::run(options), Options::Export(options) => cmd::export::run(options), Options::Hash(options) => cmd::hash::run(options), |
