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