From 2ed7435b632ae4ed9922f0c7424f446b2faae191 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Thu, 13 Jun 2024 10:56:10 +0200 Subject: [PATCH] Rename sq key password's --clear argument to --clear-password. - This makes the argument's intent clearer and more closely mirrors the other arguments, like `--new-password-file`. --- NEWS | 1 + src/cli/key.rs | 4 ++-- src/commands/key/password.rs | 2 +- tests/sq-key-password.rs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 91d034ac..cd3b2b4d 100644 --- a/NEWS +++ b/NEWS @@ -68,6 +68,7 @@ - `sq key attest-certifications` can now use the cert store and the key store. - Rename the `--expiry` argument to `--expiration`. + - Rename `sq key password`'s `--clear` argument to `--clear-password`. * Changes in 0.36.0 - Missing * Changes in 0.35.0 diff --git a/src/cli/key.rs b/src/cli/key.rs index 7206e9fb..90d6837a 100644 --- a/src/cli/key.rs +++ b/src/cli/key.rs @@ -548,7 +548,7 @@ Clear the password protection.", command: &[ "sq", "key", "password", "--old-password-file", "password-file.txt", - "--clear", + "--clear-password", "--cert", "EB28F26E2739A4870ECC47726F0073F60FD0CBF0" ], }), @@ -623,7 +623,7 @@ any surrounding whitespace like a trailing newline." long, help = "Clear the password protecting the secret key material", )] - pub clear: bool, + pub clear_password: bool, #[clap( help = FileOrStdout::HELP_OPTIONAL, diff --git a/src/commands/key/password.rs b/src/commands/key/password.rs index 5a0f5a07..4008d8cc 100644 --- a/src/commands/key/password.rs +++ b/src/commands/key/password.rs @@ -25,7 +25,7 @@ pub fn password( // None => clear password let mut get_new_password = || -> Result> { if new_password_.is_none() { - new_password_ = if command.clear { + new_password_ = if command.clear_password { Some(None) } else if let Some(path) = command.new_password_file.as_ref() { Some(Some(std::fs::read(path)?.into())) diff --git a/tests/sq-key-password.rs b/tests/sq-key-password.rs index 4f8c2e09..21284e99 100644 --- a/tests/sq-key-password.rs +++ b/tests/sq-key-password.rs @@ -100,7 +100,7 @@ fn sq_key_password() -> Result<()> { cmd.args([ "key", "password", "--old-password-file", &new_password.to_string_lossy(), - "--clear", + "--clear-password", ]); if keystore { cmd.args([