aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Hovorka <[email protected]>2021-07-04 12:00:29 -0600
committerAlexis Hovorka <[email protected]>2021-07-04 12:00:29 -0600
commitd328e2478dbb91ae0a925e9ad41c6c8b2fd4515c (patch)
treea9df48a7ca458277fbb706721df1e43b73674e2d
parentf05d6f8f3b52e3ebd5639726dd07da5668979b15 (diff)
[feat] Add basic task review typo check
-rwxr-xr-xbase/taskw7
1 files changed, 5 insertions, 2 deletions
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"