From b6d7dc8f9fc64718d8395f449b10a8758a824cd9 Mon Sep 17 00:00:00 2001 From: Alex Kelly Date: Fri, 27 Jan 2023 09:17:30 -0500 Subject: [PATCH] add a function and alias to delete and purge a task in a single tep --- taskwarrior_aliases | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/taskwarrior_aliases b/taskwarrior_aliases index 1e2b39f..e49d53f 100644 --- a/taskwarrior_aliases +++ b/taskwarrior_aliases @@ -35,6 +35,23 @@ tickle () { } alias tick=tickle +# Sometimes I want to make things go away, taskrm will delete and purge an entity +taskrm () { + TASK_CMD="task" + TASK_OPTIONS="" + if [[ $1 == "-f" ]] || [[ $1 == "--force" ]];then + TASK_OPTIONS="rc.confirmation=off" + shift + fi + if [[ $# == 0 ]]; then + echo "No arguments given, exiting" + return 1 + fi + TASKUUID=$(task $1 uuids) + $TASK_CMD $TASK_OPTIONS delete $1 && $TASK_CMD $TASK_OPTIONS purge $TASKUUID +} +alias trm="taskrm" + # These were built from inspiration from various parts of the internet, but in particular: # https://gist.github.com/simonmichael/7d57c47dc643279951f1 # https://www.reddit.com/r/taskwarrior/comments/uvwqlz/share_your_aliases/