Make sq key subkey revoke's positional arguments named arguments.

- `sq key subkey revoke`'s reason and message arguments are
    positional arguments.  Change them to be named arguments.

  - See #318.
This commit is contained in:
Neal H. Walfield 2024-10-29 10:51:49 +01:00
parent b25bbee713
commit ef785cbd12
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3
4 changed files with 18 additions and 11 deletions

3
NEWS
View File

@ -162,6 +162,9 @@
- Change `sq key revoke`'s reason and message arguments from
positional arguments to named arguments, `--reason`, and
`--message`, respectively.
- Change `sq key subkey revoke`'s reason and message arguments from
positional arguments to named arguments, `--reason`, and
`--message`, respectively.
* Changes in 0.38.0
** Notable changes

View File

@ -625,8 +625,8 @@ Revoke Alice's signing subkey.",
"sq", "key", "subkey", "revoke",
"--cert=EB28F26E2739A4870ECC47726F0073F60FD0CBF0",
"--key=42020B87D51877E5AF8D272124F3955B0B8DECC8",
"retired",
"Subkey rotation.",
"--reason", "retired",
"--message", "Subkey rotation.",
],
}),
@ -638,8 +638,8 @@ Revoke Alice's signing subkey and encryption subkeys.",
"--cert=EB28F26E2739A4870ECC47726F0073F60FD0CBF0",
"--key=42020B87D51877E5AF8D272124F3955B0B8DECC8",
"--key=74DCDEAF17D9B995679EB52BA6E65EA2C8497728",
"retired",
"Subkey rotation.",
"--reason", "retired",
"--message", "Subkey rotation.",
],
}),
],
@ -690,7 +690,9 @@ pub struct RevokeCommand {
pub keys: Vec<KeyHandle>,
#[clap(
long,
value_name = "REASON",
required = true,
help = "The reason for the revocation",
long_help = "\
The reason for the revocation.
@ -704,7 +706,9 @@ of the user ID.",
pub reason: KeyReasonForRevocation,
#[clap(
long,
value_name = "MESSAGE",
required = true,
help = "A short, explanatory text",
long_help = "\
A short, explanatory text.

View File

@ -993,8 +993,8 @@ impl Sq {
let mut cmd = self.command();
cmd.arg("key").arg("subkey").arg("revoke")
.arg(reason)
.arg(message);
.arg("--reason").arg(reason)
.arg("--message").arg(message);
for key in key_handles {
cmd.arg("--key").arg(key.to_string());

View File

@ -252,8 +252,8 @@ fn sq_key_subkey_revoke() -> Result<()> {
"subkey",
"revoke",
"--key", &subkey_fingerprint.to_string(),
reason_str,
message,
"--reason", reason_str,
"--message", message,
]);
if keystore {
@ -367,7 +367,7 @@ fn sq_key_subkey_revoke_multiple() -> Result<()> {
cmd.args(["--key", &subkey.key().fingerprint().to_string(),]);
}
cmd.args(["retired", "rotation"]);
cmd.args(["--reason", "retired", "--message", "rotation"]);
sq.run(cmd, Some(true));
let revoked = sq.cert_export(cert.key_handle());
@ -505,8 +505,8 @@ fn sq_key_subkey_revoke_thirdparty() -> Result<()> {
"subkey",
"revoke",
"--key", &subkey_fingerprint.to_string(),
reason_str,
message,
"--reason", reason_str,
"--message", message,
]);
if keystore {