spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quin...@apache.org
Subject svn commit: rev 10712 - incubator/spamassassin/trunk/masses
Date Tue, 18 May 2004 09:00:11 GMT
Author: quinlan
Date: Tue May 18 02:00:10 2004
New Revision: 10712

Modified:
   incubator/spamassassin/trunk/masses/freqdiff
Log:
add option to only read first N lines (useful for doing comparisons
between old mass-check logs and new ones if you're impatient)


Modified: incubator/spamassassin/trunk/masses/freqdiff
==============================================================================
--- incubator/spamassassin/trunk/masses/freqdiff	(original)
+++ incubator/spamassassin/trunk/masses/freqdiff	Tue May 18 02:00:10 2004
@@ -18,9 +18,9 @@
 # limitations under the License.
 # </@LICENSE>
 
-use vars qw($opt_a $opt_b $opt_c $opt_d $opt_h $opt_p $opt_r);
+use vars qw($opt_a $opt_b $opt_c $opt_d $opt_h $opt_p $opt_r $opt_l);
 use Getopt::Std;
-getopts("abcdhpr");
+getopts("abcdhprl:");
 
 my $prog = $0;
 $prog =~ s@.*/@@;
@@ -40,6 +40,7 @@
  -h    print this help
  -p    print percentage of frequencies ((first / (first + second)) * 100.0)
  -r    use relative frequencies (account for size of inputs, useful for -p)
+ -l N  only read first N lines
 
 default is -d if input line counts are within 1% of each other and -p otherwise
 EOF
@@ -143,9 +144,10 @@
 	    s/#.*//;
 	    next unless /\S/;
 	}
-        next if (/^OVERALL/);           # hit-frequencies header line
+	next if (/^OVERALL/);	# hit-frequencies header line
 
 	$line++;
+	next if ($opt_l && $line > $opt_l);
 	$last = $type;
 	# "sort | uniq -c" format
 	if (/^\s*(-?\d+|\d+\.\d+)\s+(.*)/) {

Mime
View raw message