pldb: Force the database name.
[dvddb] / pldb
diff --git a/pldb b/pldb
index 2a16fe5..73fb31d 100755 (executable)
--- a/pldb
+++ b/pldb
@@ -44,7 +44,7 @@ sub db_connect (;$) {
              RaiseError => 1,
              ReadOnly => 1,
              %$opts);
-  $DB = DBI->connect("dbi:Pg:host=roadstar", "", "", \%opts);
+  $DB = DBI->connect("dbi:Pg:host=roadstar;dbname=mdw", "", "", \%opts);
 }
 
 sub must_exist ($$@) {
@@ -104,7 +104,7 @@ defcmd "lists", sub {
   while (my @r = $st->fetchrow_array) { my ($name) = @r; print "$name\n"; }
 };
 
-defcmd "edit GROUP LIST[=[+|-]POS]|-LIST ...", sub {
+defcmd "edit GROUP LIST[[+|-]=POS]|-LIST ...", sub {
   @_ >= 2 or bail_usage;
   my ($group, @ops) = @_;
 
@@ -128,7 +128,8 @@ defcmd "edit GROUP LIST[=[+|-]POS]|-LIST ...", sub {
       my ($list) = ($1);
       must_list $list; must_member $group, $list;
       $st_del->execute($group, $list);
-    } elsif ($op =~ /^ ([^=]++) (?: = ([-+])?+ (\d++))?+ $/x) {
+    } elsif ($op =~ /^ ((?: [^-+=]++ | [-+][^=])++)
+                      (?: ([-+])?+ = ([-+]?+ \d++))?+ $/x) {
       my ($list, $rel, $pos) = ($1, $2, $3);
 
       $st_chk->execute($list);