Add sq pki path --userid-by-email.

- Add `sq pki path --userid-by-email`, which selects the self-signed
    user ID with the specified email address.  This is different from
    `--email`, which simply uses the argument's value as a user ID.

  - Fixes #212.
This commit is contained in:
Neal H. Walfield 2024-12-14 00:14:23 +01:00
parent b85dc35f5d
commit 4155dcc22d
No known key found for this signature in database
GPG Key ID: 6863C9AD5B4D22D3
2 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,7 @@ the specified user ID.
#[command(flatten)]
pub userids: UserIDDesignators<
userid_designator::PlainAddArgs,
userid_designator::PlainAddAndByArgs,
userid_designator::OneValueNoLinting,
userid_designator::AnyDocumentation>,

View File

@ -79,6 +79,9 @@ pub type ExactByAndAddArgs
pub type AllExactByAndAddArgs
= <AllUserIDsArg as std::ops::BitOr<ExactByAndAddArgs>>::Output;
pub type PlainAddAndByArgs
= <ByArgs as std::ops::BitOr<PlainAddArgs>>::Output;
/// Argument parser options.
/// Normally it is possible to designate multiple certificates. This
@ -1198,6 +1201,7 @@ mod test {
check!(ExactAndAddArgs, Exact, false, true);
check!(ExactByAndAddArgs, Exact, true, true);
check!(AllExactByAndAddArgs, Exact, true, true);
check!(PlainAddAndByArgs, Add, true, false);
}
#[test]