rev 1272 - in trunk/siesta: bin t

[prev] [thread] [next] [lurker] [Date index for 2003/07/31]

From: simon
Subject: rev 1272 - in trunk/siesta: bin t
Date: 12:21 on 31 Jul 2003
Author: simon
Date: 2003-07-31 12:21:47 +0100 (Thu, 31 Jul 2003)
New Revision: 1272

Modified:
   trunk/siesta/bin/bandito
   trunk/siesta/bin/nacho
   trunk/siesta/bin/tequila
   trunk/siesta/t/20fullsend.t
   trunk/siesta/t/30nacho.t
Log:
Add -f option to the scripts. Quell warnings.


Modified: trunk/siesta/bin/bandito
==============================================================================
--- trunk/siesta/bin/bandito	2003-07-31 09:26:51 UTC (rev 1271)
+++ trunk/siesta/bin/bandito	2003-07-31 11:21:47 UTC (rev 1272)
@@ -10,8 +10,14 @@
 use Email::LocalDelivery;
 use POSIX qw/strftime/;
 
+use Siesta::Config;
+BEGIN {
+    if (@ARGV && $ARGV[0] eq '-f') {
+        shift;
+        $Siesta::Config::CONFIG_FILE = shift;
+    }
+}
 
-
 =pod
 
 =head1 NAME
@@ -21,9 +27,20 @@
 
 =head1 USAGE
 
-    bandito <path to a mailman list config db>
+    bandito [opts] <path to a mailman list config db>
 
 
+=head1 ALTERNATIVE CONFIG FILE
+
+By default bandito will use the config file specified in
+Siesta::Config. However by doing
+
+    % bandito -f <path to some file> <path to a mailman list config db>
+
+an alternative can be used instead.
+
+
+
 =head1 DESCRIPTION
 
 Bandito is a tool for stealing configurations from mailing list managers and 

Modified: trunk/siesta/bin/nacho
==============================================================================
--- trunk/siesta/bin/nacho	2003-07-31 09:26:51 UTC (rev 1271)
+++ trunk/siesta/bin/nacho	2003-07-31 11:21:47 UTC (rev 1272)
@@ -14,15 +14,26 @@
 # this is a nasty hack, Class::DBI isn't so hot on this one
 use Siesta::Config;
 BEGIN {
-    if (@ARGV && $ARGV[0] eq '-d') {
-        shift;
-        @Siesta::Config::STORAGE = split / /, shift;
+
+    while (@ARGV) {
+        
+        if ($ARGV[0] eq '-d') {
+            shift;
+            @Siesta::Config::STORAGE = split / /, shift;
+        
+        } elsif ($ARGV[0] eq '-f') {
+            shift;
+            @Siesta::Config::CONFIG_FILE = shift;
+    
+        } elsif ($ARGV[0] eq 'create-database' ) {
+            require Siesta::DBI;
+            Siesta::DBI->init_db;
+            exit;
+        } else {
+            last;
+        }
     }
-    if (@ARGV && $ARGV[0] eq 'create-database' ) {
-        require Siesta::DBI;
-        Siesta::DBI->init_db;
-        exit;
-    }
+
 }
 
 eval {
@@ -57,6 +68,12 @@
 
         -d database
 
+
+Alternatively you can specify an alternative config file using
+
+        -f <path to config file>
+
+
 The following commands are then valid
 
 =cut

Modified: trunk/siesta/bin/tequila
==============================================================================
--- trunk/siesta/bin/tequila	2003-07-31 09:26:51 UTC (rev 1271)
+++ trunk/siesta/bin/tequila	2003-07-31 11:21:47 UTC (rev 1272)
@@ -2,8 +2,22 @@
 use strict;
 use Siesta;
 
+
+
 use constant debug => 1;
 
+
+use Siesta::Config;
+BEGIN {
+    if (@ARGV && $ARGV[0] eq '-f') {
+        shift;
+        $Siesta::Config::CONFIG_FILE = shift;
+    }
+} 
+
+
+
+
 umask 002;
 
 eval {
@@ -28,7 +42,7 @@
 
 =head1 USAGE
 
-  % cat some.mail | tequila <action> [ list name ]
+  % cat some.mail | tequila [opts] <action> [ list name ]
 
 Cat a mail to tequila passing an action list name and an optional
 action (post, sub, unsub - post being the default).
@@ -40,10 +54,19 @@
 
   % nacho create-aliases [ list name ]
 
+=head1 ALTERNATIVE CONFIG FILE
 
+By default tequila will use the config file specified in
+Siesta::Config. However by doing
+
+    % tequila -f <path to some file> <action> [ list name ]
+
+an alternative can be used instead.
+
+
 =head1 SEE ALSO
 
-L<nacho>, L<Siesta>, L<Siesa::Usage>
+L<nacho>, L<Siesta>, L<Siesa::UserGuide>
 
 =head1 COPYRIGHT
 

Modified: trunk/siesta/t/20fullsend.t
==============================================================================
--- trunk/siesta/t/20fullsend.t	2003-07-31 09:26:51 UTC (rev 1271)
+++ trunk/siesta/t/20fullsend.t	2003-07-31 11:21:47 UTC (rev 1272)
@@ -28,6 +28,8 @@
                  mail   =>  <<'MAIL');
 To: dealers@xxxxxxxx.xxxxxxxxxx
 From: Bob <bob@xxxxxxxx.xxxxxxxxxx>
+Mailer: hack to stop Mail::DeliveryStatus::BounceParser spewing
+X-Mailer: hack to stop Mail::DeliveryStatus::BounceParser spewing
 Subject: .
 
 --

Modified: trunk/siesta/t/30nacho.t
==============================================================================
--- trunk/siesta/t/30nacho.t	2003-07-31 09:26:51 UTC (rev 1271)
+++ trunk/siesta/t/30nacho.t	2003-07-31 11:21:47 UTC (rev 1272)
@@ -7,7 +7,8 @@
 use Siesta::List;
 
 my $DB    = join(' ', @Siesta::Config::STORAGE);
-my @NACHO = ($^X, qw( -Iblib/lib -Iblib/arch bin/nacho -d ), $DB );
+my $CF    = "t/lib/siesta.conf";
+my @NACHO = ($^X, qw( -Iblib/lib -Iblib/arch bin/nacho -f ), $CF, '-d', $DB );
 
 system @NACHO, qw( create-member jay@xxxxxxxx.xxxxxxxxxx );
 is( $?, 0, "added jay" );

Generated at 13:57 on 01 Jul 2004 by mariachi 0.52