diff --git a/src/lib.rs b/src/lib.rs index bb45a3a..7abced7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,7 @@ enum Message { pub struct Config { pub regex: Regex, pub status_enabled: bool, - pub stop_after: Option>, + pub count: Option>, pub password: Option, pub userids: Vec, pub workers: NonZero, @@ -111,7 +111,7 @@ impl Fingerprunk { // Increase "found" counter and stop if enough matches have been found let prev = self.counter_found.fetch_add(1, Ordering::Relaxed); - if self.config.stop_after.is_some_and(|s| prev + 1 == s.get()) { + if self.config.count.is_some_and(|s| prev + 1 == s.get()) { break; } } diff --git a/src/main.rs b/src/main.rs index 5fd25ad..79bf210 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,8 +31,8 @@ struct Args { status: StatusEnabled, /// Stop once the specified number of matching keys has been found. - #[arg(long, value_name = "NUM")] - stop_after: Option>, + #[arg(short = 'n', long, value_name = "NUM")] + count: Option>, /// Prompt for a password and use it to encrypt matching keys. /// @@ -120,7 +120,7 @@ fn main() -> anyhow::Result<()> { let config = fingerprunk::Config { regex: args.regex, status_enabled: args.status.evaluate(), - stop_after: args.stop_after, + count: args.count, password, userids: args.userid, workers,