From d328e2478dbb91ae0a925e9ad41c6c8b2fd4515c Mon Sep 17 00:00:00 2001 From: Alexis Hovorka Date: Sun, 4 Jul 2021 12:00:29 -0600 Subject: [feat] Add basic task review typo check --- base/taskw | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'base') diff --git a/base/taskw b/base/taskw index 75fbf82..8b465cf 100755 --- a/base/taskw +++ b/base/taskw @@ -214,8 +214,11 @@ case $CMD in fi ;; q) exitaltscreen ;; - *) $TASKBIN $ID modify $IN reviewed:now &>/dev/null - LASTRES="Modified: $IN" ;; + *) if [[ "$IN" != "$LASTCMD" ]] && echo "$IN" | grep -qE "^(wait|pr[oi]|dep|due) "; then + LASTRES="$(echo -ne "\e[0;31mDid you mean \"$(echo "$IN" | sed 's/ /:/')\"?")" + TASKNUMBER=$((TASKNUMBER - 1)) + else $TASKBIN $ID modify $IN reviewed:now &>/dev/null + LASTRES="Modified: $IN"; fi ;; esac LASTCMD="$IN" -- cgit v1.2.3-70-g09d2