From faef670f8b9983c680805249a041cd25e5fdcf15 Mon Sep 17 00:00:00 2001 From: Yargo Date: Wed, 14 Sep 2022 15:38:42 +0200 Subject: [PATCH] finish dotodays command, update README --- README.md | 25 ++++++++++++++++++++++++- clikan.sh | 21 +++++++++++++-------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2dd363d..3ac6098 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,10 @@ then also the configuration can be displayed by entering `c`. - `k` : define target kanban file (for direct edition, and new items) - `f` F : define filter word F as grep pattern for selection of cards (empty is changed into `.` which matches all non-empty cards) +- `p` : show planning (time scheduling) for active ("doing") cards +- `u` N U.U [[YY]MMDD] : update scheduling for card N with new expected + duration U.U and optional new target date +- `t` : put waiting cards with target of today or older into doing state - `ek` : directly edit the target kanban file with the text editor - `ec` : directly edit the configuration file with the text editor - `!` : execute arguments with shell, `/bin/sh -c` by default @@ -96,6 +100,25 @@ filling of the screen with calendar entries when using any of the In addition, the `d` command will sort the output cards according to the configuration variable `sortdir` (see below). +The `p/u/t` commands use special syntax ` @YYMMDD/U.U` in cards, +denominating the target date `YYMMDD` and the expected duration `U.U` +with special values defined in the configuration file: + +- `planunit` is just an informative string, by default "h/day" +- `tunits` is number of units (e.g hours) available per day +- `planpart` is percentage of "tunits" which may be distributed + +The `p` command calculates which amount per active card having a +target date and duration should be attributed to its task so that +it can be finished before the target date. + +The `u` command permits to set a (new) expected duration and optionally +a target date for a card. + +The `t` command scans all "waiting" cards with a target date and +duration and puts them into the doing state, if the target date +is today or already passed. + The `!` "shell escape" command will allow you to execute shell commands. If the command begins with a letter and does not match to an internal clikan command, you may even omit the leading `!` -- so be careful: @@ -279,4 +302,4 @@ by manually removing the entries marked with a `+` flag through the --- -*2020-05-11/HB9KNS,Y.Bonetti* +*2022-09-14/HB9KNS,Y.Bonetti* diff --git a/clikan.sh b/clikan.sh index 3f623de..ee95c21 100755 --- a/clikan.sh +++ b/clikan.sh @@ -1,6 +1,6 @@ #!/bin/sh # clikan.sh -- CLI Kanban -ver='2022-09-08/HB9KNS' +ver='2022-09-14/HB9KNS' conf="${CLIKANCONF:-$HOME/.clikanconf}" defkanban="$HOME/clikanban.md" @@ -209,11 +209,16 @@ dotodays(){ 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" +# only process lines with date field + if test X$edate != X + then +# (if-thens splitted due to impossible "-le" comparison if edate is empty) +# if today or earlier + if test $edate -le $stoday # save kanban entry for later - then echo "$cl" >> $buff + then echo "$cl" >> $buff + echo ": now doing $cl" + fi fi done # if at least one entry was saved @@ -259,10 +264,10 @@ command keys: f F: filter for grep pattern F (case insensitive, empty='.', use _ for space) p: show planning (time scheduling) for active (doing) cards containing @YYMMDD/U.U target date (YYMMDD) and expected duration (U.U) - t: put waiting cards with target date of today or older into doing state - h N U.U [[YY]MMDD]: update expected duration for card N and + u N U.U [[YY]MMDD]: update expected duration for card N and optionally set new target date [YY]MMDD (asks for date if card is missing @YYMMDD) + t: put waiting cards with target date of today or older into doing state ec: directly edit config file -- DANGER! ek: directly edit kanban file -- DANGER! !: execute arguments with "$myshell" @@ -433,7 +438,7 @@ p) echo "## planning for $planpart% of $tunits $planunit" done } ;; -h) if test "$coa1" = "" +u) if test "$coa1" = "" then echo "card number?" read coa1 fi