diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-06-01 04:10:00 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-06-01 04:10:00 -0300 |
commit | 9678b09a5824d84df8be30f7e43f693b6c097111 (patch) | |
tree | 42e635d2d1fd6782c3c4ec1f7f13994859e6709b | |
parent | b1a39bfc57910908c8b4ac0253770674c99a91fc (diff) | |
download | scripts-9678b09a5824d84df8be30f7e43f693b6c097111.tar.gz scripts-9678b09a5824d84df8be30f7e43f693b6c097111.tar.bz2 |
Fix: todo script functionality
-rwxr-xr-x | todo | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 "" |