Make sq key subkey add's positional parameter a named parameter.

- In `sq key subkey add`, change the certificate file parameter from a
    positional parameter to a named parameter, `--cert-file`.
This commit is contained in:
Neal H. Walfield 2024-05-29 14:00:30 +02:00
parent 42cca6b172
commit fb16a29f00
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3
4 changed files with 9 additions and 6 deletions

4
NEWS
View File

@ -31,9 +31,11 @@
positional argument, but must be specified with `--userid`.
- Change `sq cert lint` to not read from stdin by default.
- In `sq cert lint`, change the certificate file parameter from a
position parameter to a named parameter, `--cert-file`.
positional parameter to a named parameter, `--cert-file`.
- `sq cert lint` can now use the certificate store and the
keystore.
- In `sq key subkey add`, change the certificate file parameter
from a positional parameter to a named parameter, `--cert-file`.
* Changes in 0.36.0
- Missing
* Changes in 0.35.0

View File

@ -1141,11 +1141,12 @@ $ sq key subkey add --output juliet-new.key.pgp --can-sign \\
#[clap(group(ArgGroup::new("required-group").args(&["can_authenticate", "can_sign", "can_encrypt"]).required(true)))]
pub struct SubkeyAddCommand {
#[clap(
long,
default_value_t = FileOrStdin::default(),
help = FileOrStdin::HELP_OPTIONAL,
value_name = FileOrStdin::VALUE_NAME,
)]
pub input: FileOrStdin,
pub cert_file: FileOrStdin,
#[clap(
default_value_t = FileOrStdout::default(),
help = FileOrStdout::HELP_OPTIONAL,

View File

@ -158,7 +158,7 @@ fn subkey_add(
sq: Sq,
command: SubkeyAddCommand,
) -> Result<()> {
let input = command.input.open()?;
let input = command.cert_file.open()?;
let cert = Cert::from_buffered_reader(input)?;
let valid_cert = cert.with_policy(sq.policy, sq.time)?;

View File

@ -33,7 +33,7 @@ fn sq_key_subkey_generate_authentication_subkey() -> Result<()> {
"--output",
&output.to_string_lossy(),
"--can-authenticate",
&path.to_string_lossy(),
"--cert-file", &path.to_string_lossy(),
]);
cmd.assert().success();
@ -63,7 +63,7 @@ fn sq_key_subkey_generate_encryption_subkey() -> Result<()> {
"--output",
&output.to_string_lossy(),
"--can-encrypt=universal",
&path.to_string_lossy(),
"--cert-file", &path.to_string_lossy(),
]);
cmd.assert().success();
@ -103,7 +103,7 @@ fn sq_key_subkey_generate_signing_subkey() -> Result<()> {
"--output",
&output.to_string_lossy(),
"--can-sign",
&path.to_string_lossy(),
"--cert-file", &path.to_string_lossy(),
]);
cmd.assert().success();