From da6f343032cb01597dc7866e66f091adf3243a62 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 20 Nov 2021 03:10:50 +0000 Subject: Initial public snapshot With code from Bill. Thanks Bill! --- tools/todo.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tools/todo.sh (limited to 'tools/todo.sh') diff --git a/tools/todo.sh b/tools/todo.sh new file mode 100644 index 0000000..44c7929 --- /dev/null +++ b/tools/todo.sh @@ -0,0 +1,35 @@ +# This file is dedicated to the public domain. + +todo() { + if [ $# = 0 ]; then + printf "Active TODO list:\n\n" + ls TODO/ | { + while read _l; do + printf " * %s: " "$_l" + head -n1 "TODO/$_l" + done + } + return + fi + if [ $# != 1 ]; then + echo "expected 0 or 1 argument(s)" + return + fi + if [ -f "TODO/$1" ]; then + printf "Active TODO item: " + _f="TODO/$1" + elif [ -f "TODO/.$1" ]; then + printf "Inactive TODO item: " + _f="TODO/.$1" + else + echo "TODO item not found: $1" + return + fi + head -n1 "$_f" + printf "\n" + sed -n '/^====$/,$p' "$_f" + printf "====\n\nMentions in project:\n" + git grep -Fn "TODO($1)" || echo "" +} + +# vi: sw=4 ts=4 noet tw=80 cc=80 -- cgit v1.2.3