From 9678b09a5824d84df8be30f7e43f693b6c097111 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 1 Jun 2024 04:10:00 -0300 Subject: Fix: todo script functionality --- todo | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/todo b/todo index ba9127f..c51d295 100755 --- 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 @@ -79,9 +79,13 @@ function todo_list { echo "" if [ ! -z "$status" ]; then - grep -e '* [ ]' -e '-' $todo | grep "\($status\)" + if echo $todo | grep -q $status; then + grep -e '\* \[ \]' -e '-' $todo + else + grep -e '\* \[ \]' -e '-' $todo | grep "\($status\)" + fi else - grep -e '* [ ]' -e '-' $todo + grep -e '\* \[ \]' -e '-' $todo fi echo "" -- cgit v1.2.3