]> gitweb.fluxo.info Git - scripts.git/commitdiff
TODO script: adds see and help actions
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 31 Aug 2017 12:06:30 +0000 (09:06 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 31 Aug 2017 12:06:30 +0000 (09:06 -0300)
todo

diff --git a/todo b/todo
index 1671485851b957ee3d723defed8122f5ce846a4f..9c62f3267d0093f28d7e5e0e41c8349c6be37bc9 100755 (executable)
--- a/todo
+++ b/todo
@@ -49,6 +49,13 @@ if [ "$OPTION" == "list" ]; then
   todo_find | grep -v -e "^$NAME$" | sed -e "s|^$HOME|~|"
 elif [ "$OPTION" == "count" ]; then
   todo_find | grep -v $NAME | wc -l
+elif [ "$OPTION" == "see" ]; then
+  if [ ! -z "$2" ] && [ -e "$2" ]; then
+    grep "TODO" $2 | sed -e 's/^  *//'
+  fi
+elif [ "$OPTION" == "help" ]; then
+  echo "usage: $BASENAME [list|count]"
+  echo "       $BASENAME see <file>"
 else
   todo_list
 fi