mirror of
https://github.com/nelsbrock/fingerprunk.git
synced 2026-08-14 16:12:08 +02:00
add --stop-after option
This commit is contained in:
+9
-1
@@ -1,4 +1,7 @@
|
||||
use std::io::{self, IsTerminal};
|
||||
use std::{
|
||||
io::{self, IsTerminal},
|
||||
num::NonZeroU64,
|
||||
};
|
||||
|
||||
use anyhow::{Context as AnyhowContext, anyhow};
|
||||
use clap::{ArgAction, Parser, ValueEnum};
|
||||
@@ -26,6 +29,10 @@ struct Args {
|
||||
#[arg(long, value_enum, default_value_t)]
|
||||
status: StatusEnabled,
|
||||
|
||||
/// Stop once the specified number of matching keys has been found.
|
||||
#[arg(long)]
|
||||
stop_after: Option<NonZeroU64>,
|
||||
|
||||
/// Prompt for a password and use it to encrypt found keys.
|
||||
///
|
||||
/// By default, found keys are printed to stdout unencrypted. Use this if you actually plan to
|
||||
@@ -78,6 +85,7 @@ fn main() -> anyhow::Result<()> {
|
||||
let config = fingerprunk::Config {
|
||||
regex: args.regex,
|
||||
status_enabled: args.status.evaluate(),
|
||||
stop_after: args.stop_after,
|
||||
password,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user