Restore the -q[uiet] flag to 'sa-learn' that was lost in the 3.1.3 update.

This commit is contained in:
David E. O'Brien 2006-08-23 16:15:46 +00:00
parent 412e8793e7
commit db058b54a8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=171285
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,27 @@
--- sa-learn.raw.ORIG Tue Jul 25 15:02:20 2006
+++ sa-learn.raw Wed Aug 23 09:10:14 2006
@@ -109,6 +109,7 @@ GetOptions(
'local|L' => \$opt{'local'},
'no-sync|nosync' => \$opt{'nosync'},
'showdots' => \$opt{'showdots'},
+ 'quiet|q' => \$opt{'quiet'},
'progress' => \$opt{'progress'},
'use-ignores' => \$opt{'use-ignores'},
'no-rebuild|norebuild' => sub { $opt{'nosync'} = 1; warn "The --no-rebuild option has been deprecated. Please use --no-sync instead.\n" },
@@ -414,7 +415,7 @@ eval {
$progress->final() if ($opt{progress} && $progress);
my $phrase = defined $forget ? "Forgot" : "Learned";
- print "$phrase tokens from $learnedcount message(s) ($messagecount message(s) examined)\n";
+ print "$phrase tokens from $learnedcount message(s) ($messagecount message(s) examined)\n" if (!$opt{quiet});
# If we needed to make a tempfile, go delete it.
if ( defined $tempfile ) {
@@ -576,6 +577,7 @@ Options:
-C path, --configpath=path, --config-file=path Path to standard configuration dir
-p prefs, --prefspath=file, --prefs-file=file Set user preferences file
--siteconfigpath=path Path for site configs (def: /etc/mail/spamassassin)
+ -q, --quiet Reduce amount of information printed out
-D, --debug-level Print debugging messages
-V, --version Print version
-h, --help Print usage message

View File

@ -0,0 +1,19 @@
--- spamassassin.raw.orig Tue Jul 25 15:02:20 2006
+++ spamassassin.raw Wed Aug 23 09:03:48 2006
@@ -181,6 +181,7 @@ GetOptions(
'mbox' => sub { $opt{'format'} = 'mbox'; },
'mbx' => sub { $opt{'format'} = 'mbx'; },
'prefspath|prefs-file|p=s' => \$opt{'prefspath'},
+ 'quiet' => \$opt{'quiet'},
'remove-addr-from-whitelist=s' => \$opt{'remove-addr-from-whitelist'},
'remove-from-whitelist|R' => \$opt{'remove-from-whitelist'},
'remove-markup|despamassassinify|d' => \$opt{'remove-markup'},
@@ -351,7 +352,7 @@ if ( defined $tempfile ) {
# Let folks know how many messages were handled, as long as the handling
# didn't produce output (ala: check, test, or remove_markup ...)
if ( $opt{'report'} || $opt{'revoke'} || $doing_whitelist_operation ) {
- print "$count message(s) examined.\n";
+ print "$count message(s) examined.\n" unless $opt{'quiet'};
}
# if the eval died from something, report it here and return an error.