From 0d97b756660dc00f1f967c413453c763f29be561 Mon Sep 17 00:00:00 2001 From: epg <> Date: Sat, 3 Apr 2004 06:30:55 +0000 Subject: [PATCH] Add new -m option to stop processing after a certain number of messages. --- minc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/minc b/minc index 8187a74..69855f9 100755 --- a/minc +++ b/minc @@ -8,7 +8,7 @@ B - Incorporate mail from a maildir into mh folders. =head1 SYNOPSIS -B [-B] +B [-B] =head1 DESCRIPTION @@ -60,6 +60,10 @@ for testing the syntax of .mincfilter. Show help. +=item B<-m> I + +Stop processing after I messages. + =item B<-n> Dry run; do not actually incorporate the mail, but log and report to @@ -76,12 +80,13 @@ problem. =cut my $dumpfilters = 0; +my $maxmsgs; our $run = 1; my $printfilenames = 0; my %opts; -if (not getopts('dnp', \%opts)) { +if (not getopts('dm:np', \%opts)) { exit(2); } @@ -91,6 +96,10 @@ if ($opts{'d'}) { $run = 0; } +if (defined($opts{'m'})) { + $maxmsgs = $opts{'m'}; +} + if ($opts{'p'}) { $printfilenames = 1; } @@ -607,6 +616,8 @@ sub filter_mail { printf('%6d SPAM %6d saved %6d/%1d', $spam, $saved, $spam + $saved, $msgcount); + + $spam + $saved < $maxmsgs or last; } print("\n"); -- 2.56.0