]> gitweb.fluxo.info Git - scripts.git/commitdiff
TODO script: aliases and project support
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 1 Nov 2017 10:44:20 +0000 (08:44 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 1 Nov 2017 10:44:20 +0000 (08:44 -0200)
todo

diff --git a/todo b/todo
index 0543ca155aa646d123e3587ca648b8ee35aa23f5..568809b35f5ce8a820492ee5dad33c4f7e27def8 100755 (executable)
--- a/todo
+++ b/todo
@@ -66,19 +66,24 @@ if [ "$OPTION" == "find" ]; then
   todo_find | grep -v -e "^$NAME$" | sed -e "s|^$HOME|~|"
 elif [ "$OPTION" == "count" ]; then
   todo_find | grep -v $NAME | wc -l
-elif [ "$OPTION" == "show" ]; then
+elif [ "$OPTION" == "show" ] || [ "$OPTION" == "see" ] || [ "$OPTION" == "view" ]; then
   if [ ! -z "$2" ] && [ -e "$2" ]; then
     # Check TODO inside files
     grep -i "todo" $2 | sed -e 's/^  *//'
 
     # Check also for FIXMEs
     fixmes $2
+  elif cd $2 &> /dev/null; then
+    (
+    cd $2 &> /dev/null
+    find -maxdepth 1 -xtype f -iname 'todo*' -exec cat {} \; | grep -e '*' -e '-'
+    )
   fi
 elif [ "$OPTION" == "list" ]; then
   todo_list $2
 elif [ "$OPTION" == "help" ]; then
   echo "usage: $BASENAME [list|count]"
-  echo "       $BASENAME show <file>"
+  echo "       $BASENAME <show|see|view> <file|project>"
 else
   todo_list
 fi