aboutsummaryrefslogtreecommitdiffstats
path: root/tw_hooks/on-add_scheduled_work_task.pl
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-11-25 09:30:27 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-11-25 09:30:27 +0000
commit4a8ec593767ee5dc6453029d8473fdfc47f5c083 (patch)
treecbcb54747f559852b8bbdbbfdbd4e2fb7b9a228f /tw_hooks/on-add_scheduled_work_task.pl
parentd455ecf86cfcddcfcff7bc8333fdcf74a684911a (diff)
guard against having a repeat token without a delta token
Diffstat (limited to '')
-rwxr-xr-xtw_hooks/on-add_scheduled_work_task.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/tw_hooks/on-add_scheduled_work_task.pl b/tw_hooks/on-add_scheduled_work_task.pl
index ee7ebf7..7defea8 100755
--- a/tw_hooks/on-add_scheduled_work_task.pl
+++ b/tw_hooks/on-add_scheduled_work_task.pl
@@ -22,8 +22,8 @@ sub parse_scheduled
# Parse the scheduled attribute from TW
my %token_regexes = (
- tdelta => qr/%:d(\d+)/, # %dINT
- trepeat => qr/%:r(\d+)/, # %rINT
+ tdelta => qr/\+(\d+)/, # +INT (see remind man page)
+ trepeat => qr/\*(\d+)/, # *INT (see remind man page)
);
@@ -42,6 +42,7 @@ if (($original_description =~ m/$token_regexes{tdelta}/g)) {
};
if (($original_description =~ m/$token_regexes{trepeat}/g)) {
+ if ($tdelta eq "") { die "Cannot have a repeat token without a delta token" };
$trepeat = "*$1";
$original_description =~ s/$token_regexes{trepeat}//g; # remove the delta time token
} else {