From 4a8ec593767ee5dc6453029d8473fdfc47f5c083 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 25 Nov 2020 09:30:27 +0000 Subject: guard against having a repeat token without a delta token --- tw_hooks/on-add_scheduled_work_task.pl | 5 +++-- 1 file 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 { -- cgit v1.2.3