]> gitweb.fluxo.info Git - scripts.git/commitdiff
Fix: todo: minor fixes and improvements
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 19 Jul 2023 20:07:44 +0000 (17:07 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 19 Jul 2023 20:07:44 +0000 (17:07 -0300)
todo

diff --git a/todo b/todo
index f28dd8c68a90fd67cd2dac02cabe1aaaf6ac8ff5..ba9127fa4db766d2838bd31b5f5f3fcdd0d38ad2 100755 (executable)
--- a/todo
+++ b/todo
@@ -28,7 +28,7 @@ function todo_find {
 
     find $folder/ -maxdepth $TODO_MAXDEPTH -xtype f -iname 'todo*' | while read todo; do
       # Ignore lists without tasks
-      if grep -q -e '*' -e '-' $todo; then
+      if grep -q -e '* [ ]' -e '-' $todo; then
         echo $todo
       fi
     done
@@ -40,7 +40,7 @@ function todo_list {
 
   # User's Taskwarrior
   if which task &> /dev/null; then
-    if [ "`task status:pending count`" != "0" ]; then
+    if [ "`task status:pending count 2> /dev/null`" != "0" ]; then
       echo "taskwarrior:"
       #echo ""
       task list 2> /dev/null
@@ -53,7 +53,7 @@ function todo_list {
       SILENT="true"
     fi
 
-    SILENT=$SILENT tasks $taskstatus list
+    SILENT=$SILENT tasks $taskstatus list 2> /dev/null
     echo ""
   fi
 
@@ -79,9 +79,9 @@ function todo_list {
       echo ""
 
       if [ ! -z "$status" ]; then
-        grep -e '*' -e '-' $todo | grep "\($status\)"
+        grep -e '* [ ]' -e '-' $todo | grep "\($status\)"
       else
-        grep -e '*' -e '-' $todo
+        grep -e '* [ ]' -e '-' $todo
       fi
 
       echo ""