From c70aa389a56a0b7dd35830476af42f1e30966d88 Mon Sep 17 00:00:00 2001 From: Ben Savage Date: Fri, 25 Feb 2022 10:44:08 +1100 Subject: [PATCH] implementing + for unplanned tasks --- cl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cl b/cl index c0e897a..212d6c7 100755 --- a/cl +++ b/cl @@ -30,6 +30,7 @@ $0 - Captain's log i.e {{DATE %F}} fill produce the text $(date %F). If the file is executable, it will be run in the context of the user, and the output will be used instead. + Create a file in "$CLDIR" named "backlog", and it will be opened along with the other daily files, split under "tomorrow" Directories created under $BASEDIR are treated as profiles (if they exist). The default profile is assumed to be 'default'. Specify -p as the first argument to $0 to operate on a different one @@ -38,6 +39,8 @@ $0 - Captain's log Run with "review" ($0 review), and you will get a rundown of complete and incomplete tasks for the week. Optionally, supply with date-compatible strings as "$0 review [end] to use a range, end defaults to yesterday A task is considered complete if it matches the regex /^ \*/ and incomplete matching /* \-/ + Also considering + to mean "a task that was not planned, but popped up during the course of the day". + For the purposes of review it counts as incomplete, unless prefixed with \* I've also implemented /^ ~/, implying a continuing task (as opposed to - which I'm sort of considering "not only incomplete, but barely progressed/attempted"). For the purposes of review, ~ counts as Completed. I'm hoping to capture which tasks are is under-estimated. @@ -75,17 +78,17 @@ function review() { - for j in '*|~' '-' '!' ; do + for j in '\*|~' '-|\+' '!' ; do case $j in - \*|\~) echo "Completed Tasks:";; - \-) echo "Incomplete Tasks:";; + \\*\|\~) echo "Completed Tasks:";; + \-\|\\+) echo "Incomplete Tasks:";; \!) echo "Events:";; esac for i in ${DATES[@]} ; do if [ -f "$CLDIR/$i" ]; then - T="$(grep -E "^ \\$j" "$CLDIR/$i")" + T="$(grep -P "^\s($j\s)" "$CLDIR/$i")" if [ "$T" != "" ]; then echo -n " ";date "+%A %d %B %Y" -d "$i" echo "$T"|sed "s/^/\t/"