diff options
Diffstat (limited to 'sq')
-rw-r--r-- | sq/src/commands/keyring.rs | 9 | ||||
-rw-r--r-- | sq/src/sq-usage.rs | 3 | ||||
-rw-r--r-- | sq/src/sq_cli.rs | 7 |
3 files changed, 18 insertions, 1 deletions
diff --git a/sq/src/commands/keyring.rs b/sq/src/commands/keyring.rs index 04ae90b9..bb561c8e 100644 --- a/sq/src/commands/keyring.rs +++ b/sq/src/commands/keyring.rs @@ -34,12 +34,19 @@ pub fn dispatch(config: Config, m: &clap::ArgMatches) -> Result<()> { match m.subcommand() { ("filter", Some(m)) => { let any_uid_predicates = - m.is_present("name") + m.is_present("userid") + || m.is_present("name") || m.is_present("email") || m.is_present("domain"); let uid_predicate = |uid: &UserID| { let mut keep = false; + if let Some(userids) = m.values_of("userid") { + for userid in userids { + keep |= uid.value() == userid.as_bytes(); + } + } + if let Some(names) = m.values_of("name") { for name in names { keep |= uid diff --git a/sq/src/sq-usage.rs b/sq/src/sq-usage.rs index b8c71cda..bd7acefb 100644 --- a/sq/src/sq-usage.rs +++ b/sq/src/sq-usage.rs @@ -824,6 +824,9 @@ //! -o, --output <FILE> //! Writes to FILE or stdout if omitted //! +//! --userid <USERID>... +//! Case-sensitively matches on the user id, requiring an exact match. +//! //! //! ARGS: //! <FILE>... diff --git a/sq/src/sq_cli.rs b/sq/src/sq_cli.rs index 5c1a2970..c76758ba 100644 --- a/sq/src/sq_cli.rs +++ b/sq/src/sq_cli.rs @@ -776,6 +776,13 @@ $ sq keyring filter --domain example.org --prune-certs certs.pgp .arg(Arg::with_name("output") .short("o").long("output").value_name("FILE") .help("Writes to FILE or stdout if omitted")) + .arg(Arg::with_name("userid") + .long("userid").value_name("USERID") + .multiple(true).number_of_values(1) + .help("Matches on USERID") + .long_help( + "Case-sensitively matches on the \ + user id, requiring an exact match.")) .arg(Arg::with_name("name") .long("name").value_name("NAME") .multiple(true).number_of_values(1) |