From: Silvio Rhatto Date: Thu, 31 Aug 2017 12:06:30 +0000 (-0300) Subject: TODO script: adds see and help actions X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=18f650dc29d7314243dbd33a04e8a32670915115;p=scripts.git TODO script: adds see and help actions --- diff --git a/todo b/todo index 1671485..9c62f32 100755 --- 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 " else todo_list fi