diff --git a/NEWS b/NEWS index 63ca84b5..6df203b5 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/src/cli/key.rs b/src/cli/key.rs index e84208a1..b68c4903 100644 --- a/src/cli/key.rs +++ b/src/cli/key.rs @@ -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, diff --git a/src/commands/key/adopt.rs b/src/commands/key/adopt.rs index c37f629d..4617f64b 100644 --- a/src/commands/key/adopt.rs +++ b/src/commands/key/adopt.rs @@ -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, diff --git a/tests/common.rs b/tests/common.rs index c1292167..4ae336c8 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -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() {