Make sq key adopt's positional parameter a named parameter.

- In `sq key adopt`, change the certifier file parameter from a
     positional parameter to a named parameter, `--cert-file`.
This commit is contained in:
Neal H. Walfield 2024-06-08 22:38:17 +02:00
parent d76d0fcd52
commit cb13f883be
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3
4 changed files with 6 additions and 3 deletions

2
NEWS
View File

@ -56,6 +56,8 @@
- In `sq pki certify`, change the certifier file parameter from a
positional parameter to a named parameter, `--certifier-file`.
- `sq pki certify` can now use the cert store and the key store.
- In `sq key adopt`, 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

@ -1025,11 +1025,12 @@ pub struct AdoptCommand {
)]
pub allow_broken_crypto: bool,
#[clap(
long,
default_value_t = FileOrStdin::default(),
value_name = "TARGET-KEY",
help = "Add keys to TARGET-KEY or reads keys from stdin if omitted",
)]
pub certificate: FileOrStdin,
pub cert_file: FileOrStdin,
#[clap(
default_value_t = FileOrStdout::default(),
help = FileOrStdout::HELP_OPTIONAL,

View File

@ -25,7 +25,7 @@ use crate::decrypt_key;
pub fn adopt(sq: Sq, command: cli::key::AdoptCommand) -> Result<()>
{
let input = command.certificate.open()?;
let input = command.cert_file.open()?;
let cert = Cert::from_buffered_reader(input)?;
let mut wanted: Vec<(
KeyHandle,

View File

@ -399,7 +399,7 @@ impl Sq {
cmd.arg("--keyring").arg(k.as_ref());
}
cmd.arg(target);
cmd.arg("--cert-file").arg(target);
assert!(! keys.is_empty());
for k in keys.into_iter() {