aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2019-05-27 10:24:56 -0700
committerDaniel Mueller <deso@posteo.net>2019-05-27 10:24:56 -0700
commitaf14d982cfcf0cee9d364458cd9495bb981c4c98 (patch)
treed13af8a57ac23d52b9afe077faceeb7c476c0459
parente6d89a69521db96e27d65d8284acfa81f0ff4b2d (diff)
downloadnitrocli-af14d982cfcf0cee9d364458cd9495bb981c4c98.tar.gz
nitrocli-af14d982cfcf0cee9d364458cd9495bb981c4c98.tar.bz2
Remove deprecated --ascii option of otp set subcommand
The --ascii option of the otp set subcommand has been deprecated a while in favor of --format. As the next release is slated to be a major one breaking backwards compatibility, this change removes this option for good.
-rw-r--r--nitrocli/CHANGELOG.md1
-rw-r--r--nitrocli/src/args.rs21
2 files changed, 2 insertions, 20 deletions
diff --git a/nitrocli/CHANGELOG.md b/nitrocli/CHANGELOG.md
index 716ebc6..601284f 100644
--- a/nitrocli/CHANGELOG.md
+++ b/nitrocli/CHANGELOG.md
@@ -4,6 +4,7 @@ Unreleased
- Renamed `storage` command to `encrypted`
- Removed `storage status` subcommand
- Moved its output into `status` command
+- Removed previously deprecated `--ascii` option from `otp set` command
0.2.4
diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs
index c043938..765da89 100644
--- a/nitrocli/src/args.rs
+++ b/nitrocli/src/args.rs
@@ -545,7 +545,6 @@ pub fn otp_set(ctx: &mut ExecCtx<'_>, args: Vec<String>) -> Result<()> {
let mut digits = OtpMode::SixDigits;
let mut counter: u64 = 0;
let mut time_window: u16 = 30;
- let mut ascii = false;
let mut secret_format: Option<OtpSecretFormat> = None;
let fmt_help = format!(
"The format of the secret ({})",
@@ -570,7 +569,7 @@ pub fn otp_set(ctx: &mut ExecCtx<'_>, args: Vec<String>) -> Result<()> {
let _ = parser.refer(&mut secret).required().add_argument(
"secret",
argparse::Store,
- "The secret to store on the slot as a hexadecimal string (unless --ascii is set)",
+ "The secret to store on the slot as a hexadecimal string (unless overwritten by --format)",
);
let _ = parser.refer(&mut digits).add_option(
&["-d", "--digits"],
@@ -587,11 +586,6 @@ pub fn otp_set(ctx: &mut ExecCtx<'_>, args: Vec<String>) -> Result<()> {
argparse::Store,
"The time window for TOTP (default: 30)",
);
- let _ = parser.refer(&mut ascii).add_option(
- &["--ascii"],
- argparse::StoreTrue,
- "Interpret the given secret as an ASCII string of the secret (deprecated, use --format instead)"
- );
let _ = parser.refer(&mut secret_format).add_option(
&["-f", "--format"],
argparse::StoreOption,
@@ -599,19 +593,6 @@ pub fn otp_set(ctx: &mut ExecCtx<'_>, args: Vec<String>) -> Result<()> {
);
parse(ctx, parser, args)?;
- if ascii {
- if secret_format.is_some() {
- return Err(Error::from(
- "The --format and the --ascii option cannot be used at the same time",
- ));
- }
-
- println!(
- ctx,
- "Warning: The --ascii option is deprecated. Please use --format ascii instead."
- )?;
- secret_format = Some(OtpSecretFormat::Ascii);
- }
let secret_format = secret_format.unwrap_or(OtpSecretFormat::Hex);
let data = nitrokey::OtpSlotData {