todo (485B)
1 #!/bin/sh 2 3 # todo: list TODOs in current directory 4 # 5 # TODO support FIX HACK WARNING etc 6 # TODO optionally include file and line number at end 7 # TODO include code if inline comment 8 9 # Select grep to use: if in git repo use git grep, or regular grep if not 10 if git -C . rev-parse 2>/dev/null; then 11 SEARCH_CMD="git grep TODO *" 12 else 13 SEARCH_CMD="grep -RI TODO *" 14 fi 15 16 # Run search and trim everything around the note 17 eval $SEARCH_CMD | sed -n -e 's/^.*TODO[ \t:]*//p' | sed -e 's@\*/$@@'