]> gitweb.fluxo.info Git - scripts.git/commitdiff
TODO: fixes
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 13 Oct 2016 17:09:42 +0000 (14:09 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 13 Oct 2016 17:09:42 +0000 (14:09 -0300)
todo

diff --git a/todo b/todo
index f5ff50f663e2d3c4795034d73b2b16b610a19483..be217dd36de8f5cfc09330f960ffa4a9fd228c85 100755 (executable)
--- a/todo
+++ b/todo
@@ -5,7 +5,8 @@
 
 # Basic params
 CONFIG="$HOME/.config/todo"
-BASENAME="`basename $0`"
+NAME="$0"
+BASENAME="`basename $NAME`"
 OPTION="$1"
 
 # Config
@@ -26,20 +27,22 @@ function todo_find {
 }
 
 function todo_list {
-  todo_find | while read line; do
-    path="`echo $line | sed -e "s|^$HOME|~|"`"
-    delim="====`echo $path | sed -e 's|.|=|g'`"
-    echo ""
-    echo $delim
-    echo In $path:
-    echo $delim
-    echo ""
-    cat $line
+  todo_find | while read todo; do
+    if [ ! -d "$todo" ] && [ "$todo" != "$NAME" ]; then
+     path="`echo $todo | sed -e "s|^$HOME|~|"`"
+     delim="===`echo $path | sed -e 's|.|=|g'`"
+     echo ""
+     echo $delim
+     echo In $path
+     echo $delim
+     echo ""
+     cat $todo
+    fi
   done
 }
 
 if [ "$OPTION" == "list" ]; then
   todo_list | less
 else
-  todo_find | sed -e "s|^$HOME|~|"
+  todo_find | grep -v -e "^$NAME$" | sed -e "s|^$HOME|~|"
 fi