diff --git a/NEWS b/NEWS index 8d07a1d7..962affa7 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,9 @@ instead of `--email`. - `sq encrypt` now requires explicit opt-out for signing in the form of the `--without-signature` flag. + - The arguments `--userid-or-add`, `--email-or-add`, and + `--name-or-add` have respectively been renamed to `--add-userid`, + `--add-email`, and `--add-name`. * Changes in 0.41.0 ** New functionality diff --git a/sq-subplot.md b/sq-subplot.md index 5f7235aa..5db08bdc 100644 --- a/sq-subplot.md +++ b/sq-subplot.md @@ -1041,7 +1041,7 @@ when I run sq key delete --cert-file bob.pgp --output bob-cert.pgp when I run sq inspect bob-cert.pgp then stdout doesn't contain "Certifications:" -when I run sq pki vouch add --certifier-file alice.pgp --cert-file bob-cert.pgp --userid-or-add "My friend Bob" --output cert.pgp +when I run sq pki vouch add --certifier-file alice.pgp --cert-file bob-cert.pgp --add-userid "My friend Bob" --output cert.pgp when I run sq inspect cert.pgp then stdout contains "My friend Bob" then stdout contains "Certifications: 1," @@ -1060,7 +1060,7 @@ when I run sq key delete --cert-file alice.pgp --output alice-cert.pgp when I run sq key generate --own-key --without-password --userid Bob --output bob.pgp --rev-cert bob.pgp.rev when I run sq key delete --cert-file bob.pgp --output bob-cert.pgp -when I run sq pki vouch add --certifier-file alice.pgp --cert-file bob-cert.pgp --email-or-add "bob@example.org" --output cert.pgp +when I run sq pki vouch add --certifier-file alice.pgp --cert-file bob-cert.pgp --add-email "bob@example.org" --output cert.pgp when I run sq inspect cert.pgp then stdout contains "" then stdout contains "Certifications: 1," diff --git a/src/cli/key/userid.rs b/src/cli/key/userid.rs index c104b425..c4177580 100644 --- a/src/cli/key/userid.rs +++ b/src/cli/key/userid.rs @@ -194,7 +194,7 @@ policy. If the certificate is not valid under the current policy, \ consider revoking the whole certificate, or fixing it using `sq cert \ lint` after verifying the certificate's integrity. If the certificate \ is valid under the current policy, but the user ID you want to revoke \ -isn't, you can still revoke the user ID using `--userid-or-add`. +isn't, you can still revoke the user ID using `--add-userid`. `sq key userid revoke` respects the reference time set by the top-level \ `--time` argument. When set, it uses the specified time instead of \ diff --git a/src/cli/pki/link.rs b/src/cli/pki/link.rs index 3f8ccdb5..deebd87e 100644 --- a/src/cli/pki/link.rs +++ b/src/cli/pki/link.rs @@ -535,7 +535,7 @@ with the email address alice@example.org.", command: &[ "sq", "pki", "link", "add", "--cert=EB28F26E2739A4870ECC47726F0073F60FD0CBF0", - "--email-or-add=alice@example.org", + "--add-email=alice@example.org", ], hide: &[], }), diff --git a/src/cli/pki/vouch/add.rs b/src/cli/pki/vouch/add.rs index 4602e109..37aa9514 100644 --- a/src/cli/pki/vouch/add.rs +++ b/src/cli/pki/vouch/add.rs @@ -43,7 +43,7 @@ which is not a self-signed user ID.", "sq", "pki", "vouch", "add", "--certifier=EB28F26E2739A4870ECC47726F0073F60FD0CBF0", "--cert=511257EBBF077B7AEDAE5D093F68CB84CE537C9A", - "--email-or-add=bob@bobs.lair.net", + "--add-email=bob@bobs.lair.net", ], hide: &[], }), diff --git a/src/cli/types/userid_designator.rs b/src/cli/types/userid_designator.rs index a2458a37..adca00b7 100644 --- a/src/cli/types/userid_designator.rs +++ b/src/cli/types/userid_designator.rs @@ -30,8 +30,7 @@ pub type ExactArgs = typenum::U2; /// ". pub type ByArgs = typenum::U4; -/// Adds a `--userid-or-add`, `--email-or-add`, and `--name-or-add` -/// argument. +/// Adds a `--add-userid`, `--add-email`, and `--add-name` argument. /// /// For `UserIDDesignator::resolve`, acts like `ExactArgs`, but if /// there is no matching self-signed user ID, creates one from the @@ -591,7 +590,7 @@ Use all self-signed user IDs")); let full_name = if plain_is_add { "userid" } else { - "userid-or-add" + "add-userid" }; let (help, long_help) = Docs::help(UserID, false, Add); @@ -694,7 +693,7 @@ Use all self-signed user IDs")); let full_name = if plain_is_add { "email" } else { - "email-or-add" + "add-email" }; let (help, long_help) = Docs::help(Email, plain_is_add, Add); let mut arg = clap::Arg::new(&full_name) @@ -741,7 +740,7 @@ Use all self-signed user IDs")); let full_name = if plain_is_add { "name" } else { - "name-or-add" + "add-name" }; let (help, long_help) = Docs::help(Name, plain_is_add, Add); let mut arg = clap::Arg::new(&full_name) @@ -892,7 +891,7 @@ where if add_args { if let Ok(Some(userids)) = matches.try_get_many::( - if plain_is_add { "userid" } else { "userid-or-add" }) { + if plain_is_add { "userid" } else { "add-userid" }) { for userid in userids.cloned() { designators.push( UserIDDesignator::UserID(Add, userid)); @@ -900,7 +899,7 @@ where } if let Ok(Some(emails)) = matches.try_get_many::( - if plain_is_add { "email" } else { "email-or-add" }) + if plain_is_add { "email" } else { "add-email" }) { for email in emails.cloned() { designators.push( @@ -909,7 +908,7 @@ where } if let Ok(Some(names)) = matches.try_get_many::( - if plain_is_add { "name" } else { "name-or-add" }) + if plain_is_add { "name" } else { "add-name" }) { for name in names.cloned() { designators.push( @@ -1129,11 +1128,11 @@ mod test { ]); assert!(m.is_err()); - // Check if --userid-or-add is recognized. + // Check if --add-userid is recognized. let m = command.clone().try_get_matches_from(vec![ "prog", - "--userid-or-add", "alice", - "--userid-or-add", "bob", + "--add-userid", "alice", + "--add-userid", "bob", ]); if $add { let m = m.expect("valid arguments"); @@ -1144,11 +1143,11 @@ mod test { assert!(m.is_err()); } - // Check if --email-or-add is recognized. + // Check if --add-email is recognized. let m = command.clone().try_get_matches_from(vec![ "prog", - "--email-or-add", "alice@example.org", - "--email-or-add", "bob@example.org", + "--add-email", "alice@example.org", + "--add-email", "bob@example.org", ]); if $add { let m = m.expect("valid arguments"); @@ -1159,11 +1158,11 @@ mod test { assert!(m.is_err()); } - // Check if --name-or-add is recognized. + // Check if --add-name is recognized. let m = command.clone().try_get_matches_from(vec![ "prog", - "--name-or-add", "alice", - "--name-or-add", "bob", + "--add-name", "alice", + "--add-name", "bob", ]); if $add { let m = m.expect("valid arguments"); @@ -1333,11 +1332,11 @@ mod test { ("--userid", "foo"), ("--userid-by-email", "foo@example.org"), ("--userid-by-name", "foo"), - ("--userid-or-add", "foo"), + ("--add-userid", "foo"), ("--email", "foo@example.org"), - ("--email-or-add", "foo@example.org"), + ("--add-email", "foo@example.org"), ("--name", "foo"), - ("--name-or-add", "foo"), + ("--add-name", "foo"), ] { // Make sure the arg/value are recognized. diff --git a/src/commands/key/userid.rs b/src/commands/key/userid.rs index 1d53ce25..9c164d91 100644 --- a/src/commands/key/userid.rs +++ b/src/commands/key/userid.rs @@ -304,7 +304,7 @@ pub fn userid_revoke( // To revoke a user ID, we require the certificate be valid under // the current policy. Users can still revoke user IDs whose // binding signature relies on weak cryptography using - // `--user-or-add`. + // `--add-user`. let vcert = cert.with_policy(sq.policy, sq.time) .with_context(|| { format!("The certificate is not valid under the current \ diff --git a/src/common/types/userid_designator.rs b/src/common/types/userid_designator.rs index 6c93e7ac..9dbe3500 100644 --- a/src/common/types/userid_designator.rs +++ b/src/common/types/userid_designator.rs @@ -307,7 +307,7 @@ where if missing { if add_args { - weprintln!("Use `--userid-or-add` or `--email-or-add` to use \ + weprintln!("Use `--add-userid` or `--add-email` to use \ a user ID even if it isn't self signed, or has \ an invalid self signature."); } @@ -315,14 +315,14 @@ where } if ambiguous_email { weprintln!("Use `--userid` with the full user ID, or \ - `--userid-or-add` to add a new user ID."); + `--add-userid` to add a new user ID."); return Err(anyhow::anyhow!("\ An email address does not unambiguously designate a \ self-signed user ID")); } if ambiguous_name { weprintln!("Use `--userid` with the full user ID, or \ - `--userid-or-add` to add a new user ID."); + `--add-userid` to add a new user ID."); return Err(anyhow::anyhow!("\ A name does not unambiguously designate a \ self-signed user ID")); diff --git a/tests/integration/common.rs b/tests/integration/common.rs index 152c9875..ac970e66 100644 --- a/tests/integration/common.rs +++ b/tests/integration/common.rs @@ -282,9 +282,9 @@ impl UserIDArg<'_> { UserIDArg::Name(name) => cmd.arg("--name").arg(name), UserIDArg::AddUserID(userid) => - cmd.arg("--userid-or-add").arg(userid), + cmd.arg("--add-userid").arg(userid), UserIDArg::AddEmail(email) => - cmd.arg("--email-or-add").arg(email), + cmd.arg("--add-email").arg(email), UserIDArg::ByEmail(email) => cmd.arg("--userid-by-email").arg(email), }; diff --git a/tests/integration/sq_key_userid_revoke.rs b/tests/integration/sq_key_userid_revoke.rs index 1adc86da..04831609 100644 --- a/tests/integration/sq_key_userid_revoke.rs +++ b/tests/integration/sq_key_userid_revoke.rs @@ -103,7 +103,7 @@ fn unbound_userid() { updated_path.as_path()) .is_err()); - // But it should work with --userid-or-add. + // But it should work with --add-userid. sq.key_userid_revoke( &[], &cert_path, @@ -281,7 +281,7 @@ fn userid_designators() { assert!(sq.pki_authenticate( &[], &fpr, UserIDArg::UserID(other_userid)).is_ok()); - // 2. --userid-or-add: use the specified user ID. + // 2. --add-userid: use the specified user ID. let (cert, fpr, sq) = setup(); // Self-signed and authenticated. @@ -320,7 +320,7 @@ fn userid_designators() { UserIDArg::Email(other_email)).is_err()); revocations(&sq, cert.key_handle(), other_userid, 0); - // 4. --email-or-add: use a user ID with the email address. + // 4. --add-email: use a user ID with the email address. let (cert, fpr, sq) = setup(); // Self-signed and authenticated. diff --git a/tests/integration/sq_pki_link.rs b/tests/integration/sq_pki_link.rs index 15b84213..6d7fa032 100644 --- a/tests/integration/sq_pki_link.rs +++ b/tests/integration/sq_pki_link.rs @@ -791,7 +791,7 @@ fn no_ambiguous_email() { sq.pki_link_add_maybe( &[], alice.key_handle(), &[UserIDArg::Email("alice@example.org")]) .is_err()); - // --email-or-add links a user ID with the email address: + // --add-email links a user ID with the email address: // Ambiguous is allowed. assert!( sq.pki_link_add_maybe( @@ -904,7 +904,7 @@ fn link_userid_designators() { &[], &fpr, UserIDArg::UserID("Alice ")).is_ok()); - // 2. Use --userid-or-add to link "Alice ", which + // 2. Use --add-userid to link "Alice ", which // is not a self-signed user ID. // This fails with --userid, because it expects a self-signed user ID. @@ -912,7 +912,7 @@ fn link_userid_designators() { &mut sq, cert.key_handle(), UserIDArg::UserID("Alice ")).is_err()); - // But it works with --userid-or-add. + // But it works with --add-userid. link(&mut sq, cert.key_handle(), UserIDArg::AddUserID("Alice ")); assert!(sq.pki_authenticate( @@ -933,7 +933,7 @@ fn link_userid_designators() { &[], &fpr, UserIDArg::UserID("Alice ")).is_ok()); - // 4. Use --email-or-add to link "", which is + // 4. Use --add-email to link "", which is // not part of a self signed user ID. // This fails with --email, because it expects a self-signed user ID. @@ -941,13 +941,13 @@ fn link_userid_designators() { &mut sq, cert.key_handle(), UserIDArg::Email("alice@example.com")).is_err()); - // But it works with --email-or-add. + // But it works with --add-email. link(&mut sq, cert.key_handle(), UserIDArg::AddEmail("alice@example.com")); assert!(sq.pki_authenticate( &[], &fpr, UserIDArg::UserID("")).is_ok()); - // Use --email-or-add to link "", which is + // Use --add-email to link "", which is // part of the self signed user ID "Alice ". // This should link "", not the self-signed // user ID. diff --git a/tests/integration/sq_pki_vouch_add.rs b/tests/integration/sq_pki_vouch_add.rs index ae943fb6..75f996bb 100644 --- a/tests/integration/sq_pki_vouch_add.rs +++ b/tests/integration/sq_pki_vouch_add.rs @@ -562,7 +562,7 @@ fn userid_designators() { &[], &fpr, UserIDArg::UserID("Alice ")).is_ok()); - // 2. Use --userid-or-add to certify "Alice ", + // 2. Use --add-userid to certify "Alice ", // which is not a self-signed user ID. // This fails with --userid, because it expects a self-signed @@ -571,7 +571,7 @@ fn userid_designators() { &mut sq, cert.key_handle(), UserIDArg::UserID("Alice ")).is_err()); - // But it works with --userid-or-add. + // But it works with --add-userid. vouch(&mut sq, cert.key_handle(), UserIDArg::AddUserID("Alice ")); assert!(sq.pki_authenticate( @@ -592,7 +592,7 @@ fn userid_designators() { &[], &fpr, UserIDArg::UserID("Alice ")).is_ok()); - // 4. Use --email-or-add to certify "", + // 4. Use --add-email to certify "", // which is not part of a self signed user ID. // This fails with --email, because it expects a self-signed @@ -601,13 +601,13 @@ fn userid_designators() { &mut sq, cert.key_handle(), UserIDArg::Email("alice@example.com")).is_err()); - // But it works with --email-or-add. + // But it works with --add-email. vouch(&mut sq, cert.key_handle(), UserIDArg::AddEmail("alice@example.com")); assert!(sq.pki_authenticate( &[], &fpr, UserIDArg::UserID("")).is_ok()); - // Use --email-or-add to link "", which is + // Use --add-email to link "", which is // part of the self signed user ID "Alice ". // This should link "", not the self-signed // user ID.