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

- `sq key userid 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:57:43 +01:00
parent ef785cbd12
commit 89cb9d6743
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3
4 changed files with 18 additions and 6 deletions

3
NEWS
View File

@ -165,6 +165,9 @@
- Change `sq key subkey revoke`'s reason and message arguments from
positional arguments to named arguments, `--reason`, and
`--message`, respectively.
- Change `sq key userid 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

@ -177,7 +177,8 @@ Retire a user ID on Alice's key.",
"sq", "key", "userid", "revoke",
"--cert", "EB28F26E2739A4870ECC47726F0073F60FD0CBF0",
"--userid", "Alice <alice@example.org>",
"retired", "No longer at example.org.",
"--reason", "retired",
"--message", "No longer at example.org.",
],
}),
]
@ -262,8 +263,10 @@ not self signed."
pub add_userid: bool,
#[clap(
long,
value_enum,
value_name = "REASON",
required = true,
help = "The reason for the revocation",
long_help = "\
The reason for the revocation.
@ -276,7 +279,9 @@ of the user ID."
pub reason: UserIDReasonForRevocation,
#[clap(
long,
value_name = "MESSAGE",
required = true,
help = "A short, explanatory text",
long_help = "\
A short, explanatory text.

View File

@ -1202,7 +1202,11 @@ impl Sq {
let output_file = output_file.into();
let mut cmd = self.command();
cmd.args(["key", "userid", "revoke", reason, message]);
cmd.args([
"key", "userid", "revoke",
"--reason", reason,
"--message", message,
]);
for arg in args {
cmd.arg(arg);
}

View File

@ -95,8 +95,8 @@ fn sq_key_userid_revoke() -> Result<()> {
"userid",
"revoke",
"--userid", userid_revoke,
reason_str,
message,
"--reason", reason_str,
"--message", message,
]);
if keystore {
@ -264,8 +264,8 @@ fn sq_key_userid_revoke_thirdparty() -> Result<()> {
"userid",
"revoke",
"--userid", userid_revoke,
reason_str,
message,
"--reason", reason_str,
"--message", message,
]);
if keystore {