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`.
This commit is contained in:
Neal H. Walfield 2024-06-13 10:56:10 +02:00
parent 02cd47c6e3
commit 2ed7435b63
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3
4 changed files with 5 additions and 4 deletions

1
NEWS
View File

@ -68,6 +68,7 @@
- `sq key attest-certifications` can now use the cert store and the - `sq key attest-certifications` can now use the cert store and the
key store. key store.
- Rename the `--expiry` argument to `--expiration`. - Rename the `--expiry` argument to `--expiration`.
- Rename `sq key password`'s `--clear` argument to `--clear-password`.
* Changes in 0.36.0 * Changes in 0.36.0
- Missing - Missing
* Changes in 0.35.0 * Changes in 0.35.0

View File

@ -548,7 +548,7 @@ Clear the password protection.",
command: &[ command: &[
"sq", "key", "password", "sq", "key", "password",
"--old-password-file", "password-file.txt", "--old-password-file", "password-file.txt",
"--clear", "--clear-password",
"--cert", "EB28F26E2739A4870ECC47726F0073F60FD0CBF0" "--cert", "EB28F26E2739A4870ECC47726F0073F60FD0CBF0"
], ],
}), }),
@ -623,7 +623,7 @@ any surrounding whitespace like a trailing newline."
long, long,
help = "Clear the password protecting the secret key material", help = "Clear the password protecting the secret key material",
)] )]
pub clear: bool, pub clear_password: bool,
#[clap( #[clap(
help = FileOrStdout::HELP_OPTIONAL, help = FileOrStdout::HELP_OPTIONAL,

View File

@ -25,7 +25,7 @@ pub fn password(
// None => clear password // None => clear password
let mut get_new_password = || -> Result<Option<Password>> { let mut get_new_password = || -> Result<Option<Password>> {
if new_password_.is_none() { if new_password_.is_none() {
new_password_ = if command.clear { new_password_ = if command.clear_password {
Some(None) Some(None)
} else if let Some(path) = command.new_password_file.as_ref() { } else if let Some(path) = command.new_password_file.as_ref() {
Some(Some(std::fs::read(path)?.into())) Some(Some(std::fs::read(path)?.into()))

View File

@ -100,7 +100,7 @@ fn sq_key_password() -> Result<()> {
cmd.args([ cmd.args([
"key", "password", "key", "password",
"--old-password-file", &new_password.to_string_lossy(), "--old-password-file", &new_password.to_string_lossy(),
"--clear", "--clear-password",
]); ]);
if keystore { if keystore {
cmd.args([ cmd.args([