factor test setup code into a module
[scpubgit/App-EzPz.git] / bin / ezpz-admin-repl
index 22850c6..47475a5 100755 (executable)
@@ -5,8 +5,8 @@ use File::Which;
 use App::EzPz::UserStore;
 use strictures 1;
 
-die "Usage: ezpz-admin-repl ezmlm-bindir htpasswd-file"
-  unless @ARGV == 2;
+die "Usage: ezpz-admin-repl htpasswd-file [ezmlm-bindir list-base-dir]"
+  unless @ARGV == 1 or @ARGV == 3;
 
 {
   package Eval::WithLexicals::Scratchpad;
@@ -14,11 +14,14 @@ die "Usage: ezpz-admin-repl ezmlm-bindir htpasswd-file"
   use vars qw($users);
 
   $users = App::EzPz::UserStore->new(
-    ezmlm_bindir => $ARGV[0],
-    htpasswd_file => $ARGV[1],
+    htpasswd_file => $ARGV[0],
+    (@ARGV > 1)
+      ? (ezmlm_config => {
+           bindir => $ARGV[1],
+           list_base_dir => $ARGV[2],
+        })
+      : ()
   );
 }
 
 do +which('tinyrepl');
-
-exit 0;