feat: rename --stop-after to --count/-n

This commit is contained in:
2026-05-22 19:51:41 +02:00
parent 20c0a919c5
commit a07aaca068
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ enum Message {
pub struct Config { pub struct Config {
pub regex: Regex, pub regex: Regex,
pub status_enabled: bool, pub status_enabled: bool,
pub stop_after: Option<NonZero<u64>>, pub count: Option<NonZero<u64>>,
pub password: Option<Password>, pub password: Option<Password>,
pub userids: Vec<UserID>, pub userids: Vec<UserID>,
pub workers: NonZero<usize>, pub workers: NonZero<usize>,
@@ -111,7 +111,7 @@ impl Fingerprunk {
// Increase "found" counter and stop if enough matches have been found // Increase "found" counter and stop if enough matches have been found
let prev = self.counter_found.fetch_add(1, Ordering::Relaxed); 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; break;
} }
} }
+3 -3
View File
@@ -31,8 +31,8 @@ struct Args {
status: StatusEnabled, status: StatusEnabled,
/// Stop once the specified number of matching keys has been found. /// Stop once the specified number of matching keys has been found.
#[arg(long, value_name = "NUM")] #[arg(short = 'n', long, value_name = "NUM")]
stop_after: Option<NonZero<u64>>, count: Option<NonZero<u64>>,
/// Prompt for a password and use it to encrypt matching keys. /// Prompt for a password and use it to encrypt matching keys.
/// ///
@@ -120,7 +120,7 @@ fn main() -> anyhow::Result<()> {
let config = fingerprunk::Config { let config = fingerprunk::Config {
regex: args.regex, regex: args.regex,
status_enabled: args.status.evaluate(), status_enabled: args.status.evaluate(),
stop_after: args.stop_after, count: args.count,
password, password,
userids: args.userid, userids: args.userid,
workers, workers,