From 93e138a41fe13404ca11fd3bfa4c2febfbf05fd6 Mon Sep 17 00:00:00 2001 From: Y Date: Fri, 9 Sep 2022 16:25:07 +0000 Subject: [PATCH] cont.dotodays --- clikan.sh | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/clikan.sh b/clikan.sh index f2e2ea0..3f623de 100755 --- a/clikan.sh +++ b/clikan.sh @@ -1,6 +1,6 @@ #!/bin/sh # clikan.sh -- CLI Kanban -ver='2022-07-18/HB9KNS' +ver='2022-09-08/HB9KNS' conf="${CLIKANCONF:-$HOME/.clikanconf}" defkanban="$HOME/clikanban.md" @@ -83,6 +83,16 @@ getlines(){ } } +# extract date part of tepatt from argument +getsdate() { + local dp + dp=`echo "$*" | sed -e "s/.*$tepatt.*/\1/"` + if test "$dp" = "$*" + then echo '' + else echo $dp + fi +} + # display selection, and put selection list in selection file, # input through stdin, with lines prepended with index number, TAB and arg1 showselect(){ @@ -193,7 +203,28 @@ repline(){ # put waiting cards of today or older into doing state dotodays(){ - echo :: yet unimplemented + local edate + : > $buff +# scan all kanbans for waiting entries (-) with matching dates + cat $kbs | getlines - | { while read cl + do + edate=`getsdate "$cl"` +echo ::::: $cl ::::: $edate +# if date field exists and is lessequal than today + if test -n "$edate" -a "$edate" -le "$stoday" +# save kanban entry for later + then echo "$cl" >> $buff + fi + done +# if at least one entry was saved + if test -s $buff + then cat $buff | { while read cl +# change flag in all kanbans from waiting (-) to doing (*) + do repline "- $cl" "* $cl" + done + } + fi + } } showhelp(){ cat <