From 86ca219149cec6da6fe3f32799ed70c7e159e0ad Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 29 May 2022 15:34:00 +0100 Subject: [PATCH] pldb: Use more sensible `-=' and `+=' syntax for relative updates. --- pldb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pldb b/pldb index 2a16fe5..2e70b6c 100755 --- a/pldb +++ b/pldb @@ -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); -- 2.11.0