You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/07/23 05:13:00 UTC

svn commit: rev 23169 - in spamassassin/trunk: . spamd

Author: felicity
Date: Thu Jul 22 20:12:59 2004
New Revision: 23169

Modified:
   spamassassin/trunk/sa-learn.raw
   spamassassin/trunk/spamassassin.raw
   spamassassin/trunk/spamd/spamd.raw
Log:
bug 3554: we should keep commandline support for all deprecated or removed options, and either put out a warning (for options we can ignore) or an error/die (for options that can't).  for things like the shift from 2.x to 3.x, and -a changing to a config option, we should error out and let the user know to look up the config option.

Modified: spamassassin/trunk/sa-learn.raw
==============================================================================
--- spamassassin/trunk/sa-learn.raw	(original)
+++ spamassassin/trunk/sa-learn.raw	Thu Jul 22 20:12:59 2004
@@ -92,21 +92,23 @@
 );
 
 GetOptions(
-  'forget'       => \$forget,
-  'ham|nonspam'  => sub { $isspam = 0; },
-  'spam'         => sub { $isspam = 1; },
-  'sync|rebuild' => \$synconly,
+  'forget'      => \$forget,
+  'ham|nonspam' => sub { $isspam = 0; },
+  'spam'        => sub { $isspam = 1; },
+  'sync'        => \$synconly,
+  'rebuild'     => sub { $synconly = 1; warn "The --rebuild option has been deprecated.  Please use --sync instead.\n" },
 
   'configpath|config-file|config-dir|c|C=s' => \$opt{'configpath'},
   'prefspath|prefs-file|p=s'                => \$opt{'prefspath'},
   'siteconfigpath=s'                        => \$opt{'siteconfigpath'},
 
-  'folders|f=s'                         => \$opt{'folders'},
-  'force-expire|expire'                 => \$opt{'force-expire'},
-  'local|L'                             => \$opt{'local'},
-  'no-sync|nosync|no-rebuild|norebuild' => \$opt{'nosync'},
-  'showdots'                            => \$opt{'showdots'},
-  'use-ignores'                         => \$opt{'use-ignores'},
+  'folders|f=s'          => \$opt{'folders'},
+  'force-expire|expire'  => \$opt{'force-expire'},
+  'local|L'              => \$opt{'local'},
+  'no-sync|nosync'       => \$opt{'nosync'},
+  'showdots'             => \$opt{'showdots'},
+  '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" },
 
   'learnprob=f' => \$opt{'learnprob'},
   'randseed=i'  => \$opt{'randseed'},

Modified: spamassassin/trunk/spamassassin.raw
==============================================================================
--- spamassassin/trunk/spamassassin.raw	(original)
+++ spamassassin/trunk/spamassassin.raw	Thu Jul 22 20:12:59 2004
@@ -169,6 +169,31 @@
   'test-mode|test|t'                        => \$opt{'test-mode'},
   'version|V'                               => \$opt{'version'},
   'x'                                       => sub { $opt{'create-prefs'} = 0 },
+
+  #
+  # NOTE: These are old options.  We should ignore (but warn about)
+  # the ones that are now defaults.  Everything else gets a die (see note2)
+  # so the user doesn't get us doing something they didn't expect.
+  #
+  # NOTE2: 'die' doesn't actually stop the process, GetOptions() catches
+  # it, then passes the error on, so we'll end up doing a Usage statement.
+  # You can avoid that by doing an explicit exit in the sub.
+  #
+
+  # last in 2.3
+  'pipe|P'                => sub { warn "The -P option is deprecated as 'pipe mode' is now the default behavior, ignoring.\n" },
+  'F:i'                   => sub { warn "The -F option has been removed from spamassassin, please remove from your commandline and re-run.\n"; exit 2; },
+  'add-from!'             => sub { warn "The --add-from option has been removed from spamassassin, please remove from your commandline and re-run.\n"; exit 2; },
+  
+  # last in 2.4
+  'stop-at-threshold|S'   => sub { warn "The -S option has been deprecated and is no longer supported, ignoring.\n" },
+
+  # last in 2.6
+  'log-to-mbox|l:s'       => sub { warn "The -l option has been deprecated and is no longer supported, ignoring.\n" },
+  'auto-whitelist|a'      => sub { warn "The -a option has been removed.  Please look at the use_auto_whitelist config option instead.\n"; exit 2; },
+  'warning-from|w:s'      => sub { warn "The -w option has been removed from spamassassin, please remove from your commandline and re-run.\n"; exit 2; }, 
+  'whitelist-factory|M:s' => sub { warn "The -M option has been removed from spamassassin, please remove from your commandline and re-run.\n"; exit 2; },
+
 ) or print_usage_and_exit();
 
 if ( defined $opt{'help'} ) {

Modified: spamassassin/trunk/spamd/spamd.raw
==============================================================================
--- spamassassin/trunk/spamd/spamd.raw	(original)
+++ spamassassin/trunk/spamd/spamd.raw	Thu Jul 22 20:12:59 2004
@@ -182,6 +182,27 @@
   'virtual-config-dir=s'     => \$opt{'virtual-config-dir'},
   'v'                        => \$opt{'vpopmail'},
   'vpopmail!'                => \$opt{'vpopmail'},
+
+  #
+  # NOTE: These are old options.  We should ignore (but warn about)
+  # the ones that are now defaults.  Everything else gets a die (see note2)
+  # so the user doesn't get us doing something they didn't expect.
+  #
+  # NOTE2: 'die' doesn't actually stop the process, GetOptions() catches
+  # it, then passes the error on, so we'll end up doing a Usage statement.
+  # You can avoid that by doing an explicit exit in the sub.
+  #
+  
+  # last in 2.3
+  'F:i'                   => sub { warn "The -F option has been removed from spamd, please remove from your commandline and re-run.\n"; exit 2; },
+  'add-from!'             => sub { warn "The --add-from option has been removed from spamd, please remove from your commandline and re-run.\n"; exit 2; },
+
+  # last in 2.4
+  'stop-at-threshold|S!' => sub { warn "The -S option has been deprecated and is no longer supported, ignoring.\n" },
+
+  # last in 2.6
+  'auto-whitelist|whitelist|a'      => sub { warn "The -a option has been removed.  Please look at the use_auto_whitelist config option instead.\n"; exit 2; },
+
 ) or print_usage_and_exit();
 	
 if ($opt{'help'}) {