From 27de42f1103ef6afde1165e85574c392c7167bbb Mon Sep 17 00:00:00 2001 From: Y Date: Mon, 18 Jul 2022 13:24:02 +0000 Subject: [PATCH] improve filtering (case insensitive, _ for space) and help display --- clikan.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/clikan.sh b/clikan.sh index efba6a0..be656f1 100755 --- a/clikan.sh +++ b/clikan.sh @@ -1,6 +1,6 @@ #!/bin/sh # clikan.sh -- CLI Kanban -ver='2021-09-09/HB9KNS' +ver='2022-07-18/HB9KNS' conf="${CLIKANCONF:-$HOME/.clikanconf}" defkanban="$HOME/clikanban.md" @@ -163,11 +163,11 @@ showall(){ if test "$f" = "*" then t=`date +%m-%d` # for "doing", sort filtered cards - cat $kbs | grep -e $filtr | getlines "$f" | condsort + cat $kbs | grep -i -e "$filtr" | getlines "$f" | condsort # and also display '- ...(MM-DD)...' calendar entries cat $kbs | grep "^[*+-] .*($t)" | sed -e 's/^. //' # for waiting and archive, filter but keep saved card order - else cat $kbs | grep -e $filtr | getlines "$f" + else cat $kbs | grep -i -e "$filtr" | getlines "$f" # for all cases, select the cards and show the beginning of the list fi | showselect "$f " | head -n $ms } @@ -220,7 +220,7 @@ command keys: wait N: put card N back to waiting/todo state do N: put card N into doing state note: done/wait/do accept several arguments separated by white space - f F: filter cards for grep pattern F (empty='.') + 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) h N U.U [[YY]MMDD]: update expected duration for card N and @@ -328,7 +328,8 @@ ec) echo calling "$editor $conf" ... ek) echo calling "$editor $currkan" ... "$editor" "$currkan" ;; f) filtr="${coa1:-.}" - echo "filtering for grep pattern '$filtr'" ;; + echo "filtering for grep pattern '$filtr' (_ means SPC)" + filtr=`echo "$filtr" | sed -e 's/_/ /g'` ;; p) echo "## planning for $planpart% of $tunits $planunit" # generate list, but hidden showall doing >/dev/null @@ -474,6 +475,8 @@ h) if test "$coa1" = "" $myshell "$com $coa1 $coa2 $coa3 $coar" echo ;; *) showhelp + echo '(hit return to continue)' + read _ showall doing ;; esac showprompt