diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2020-12-02 21:22:08 +0100 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2020-12-02 21:22:08 +0100 |
| commit | c8288d780d381658b569f205cb732e2b43764717 (patch) | |
| tree | d5fa9afa5d88fd24bfc347a27d11dae35b6c8cb2 /src/cmd/export.rs | |
| parent | e00c34041a67b3e59de4aaf0c8efe24823a1e5f3 (diff) | |
added export subcommand
Diffstat (limited to 'src/cmd/export.rs')
| -rw-r--r-- | src/cmd/export.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cmd/export.rs b/src/cmd/export.rs new file mode 100644 index 0000000..1e78098 --- /dev/null +++ b/src/cmd/export.rs @@ -0,0 +1,19 @@ +//! Module implementing the `export` subcommand for displaying an account's +//! private key. + +use crate::cmd::AccountOptions; +use anyhow::Result; +use structopt::StructOpt; + +#[derive(Debug, StructOpt)] +#[structopt(about = "Export a private key")] +pub struct Options { + #[structopt(flatten)] + account: AccountOptions, +} + +pub fn run(options: Options) -> Result<()> { + let key = options.account.private_key()?; + println!("0x{}", hex::encode(key.secret())); + Ok(()) +} |
