aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/hex.rs
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2022-01-14 09:46:57 +0100
committerNicholas Rodrigues Lordello <[email protected]>2022-01-14 09:46:57 +0100
commita3c2005b0b57ba66d612dea7281ae95c1ad445c4 (patch)
treeba5cdca434c10eb9941f1cc370544b5235d9bd14 /src/cmd/hex.rs
parent22ccb7895637e041c17a76eb96c54f16a00e182d (diff)
migrate to clap
Diffstat (limited to 'src/cmd/hex.rs')
-rw-r--r--src/cmd/hex.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/hex.rs b/src/cmd/hex.rs
index 48eb02f..143bc43 100644
--- a/src/cmd/hex.rs
+++ b/src/cmd/hex.rs
@@ -6,32 +6,32 @@
use crate::cmd;
use anyhow::Result;
+use clap::Parser;
use std::{
io::{self, Write},
path::PathBuf,
str,
};
-use structopt::StructOpt;
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct Options {
- #[structopt(subcommand)]
+ #[clap(subcommand)]
op: Op,
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
enum Op {
/// Encode binary data as a hexadecimal string.
Encode {
/// Path to the data to encode. Use `-` for standard in.
- #[structopt(name = "DATA", default_value = "-")]
+ #[clap(name = "DATA", default_value = "-")]
data: PathBuf,
},
/// Decode a hexadecimal string as binary data.
Decode {
/// Path to the data to decode. Use `-` for standard in.
- #[structopt(name = "DATA", default_value = "-")]
+ #[clap(name = "DATA", default_value = "-")]
data: PathBuf,
},
}