diff --git a/scripts/todolist b/scripts/todolist index 4956e6e..b37dd75 100755 --- a/scripts/todolist +++ b/scripts/todolist @@ -4,8 +4,14 @@ [ -n "$1" ] && cd "$1" +if ! command -v rg &>/dev/null; then + GREP_CMD="grep -R -n" +else + GREP_CMD="rg" +fi + if git rev-parse --show-toplevel &>/dev/null; then - grep -n -R "^[[:space:]]*[#/\";-]*[[:space:]]*TODO:" . \ + $GREP_CMD "^[[:space:]]*[#/\";-]*[[:space:]]*TODO:" . \ | expand \ | sed -r 's/([[:digit:]]):/\1:@@ /' \ | tr -s ' ' \