From 30c26304ee77b7857502b430ab3a8ecacc5bf726 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Sun, 9 Feb 2020 08:51:55 +0300 Subject: [PATCH] todolist: get all TODO marks of current git repository --- README.md | 1 + calculator | 4 +--- todolist | 10 ++++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 todolist diff --git a/README.md b/README.md index d5e69b0..fcb9c50 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ will create the symbolic link for each script in the \ directory. - [doctools2man](doctools2man) converts doctool to man pages. - [how](how) shows dev cheat sheets using [cheat.sh](https://cheat.sh). - [robodoc2html](robodoc2html) converts a documentation in the robodoc format into html. +- [todolist](todolist) shows all `TODO` notes in current git repository. - [utable](utable) shows a Unicode table. ### Git diff --git a/calculator b/calculator index 1604a88..65b3546 100755 --- a/calculator +++ b/calculator @@ -1,8 +1,6 @@ #!/bin/bash -#TODO: -# EUR -# RUB +#TODO: EUR -> RUB vars=( $(echo {a..z}) ) count=-1 diff --git a/todolist b/todolist new file mode 100755 index 0000000..c4ae293 --- /dev/null +++ b/todolist @@ -0,0 +1,10 @@ +#!/bin/bash + +# Find all TODO: marks in current git repository + +[ -n "$1" ] && cd "$1" + +if git rev-parse --show-toplevel &>/dev/null; then + grep -n -R "^[[:space:]]*[#/\"-]*[[:space:]]*TODO:" +fi +