Browse Source

todolist: user rg instead of grep

master
Maxim Likhachev 4 years ago
parent
commit
ee3e656d14
  1. 8
      scripts/todolist

8
scripts/todolist

@ -4,8 +4,14 @@
[ -n "$1" ] && cd "$1" [ -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 if git rev-parse --show-toplevel &>/dev/null; then
grep -n -R "^[[:space:]]*[#/\";-]*[[:space:]]*TODO:" . \ $GREP_CMD "^[[:space:]]*[#/\";-]*[[:space:]]*TODO:" . \
| expand \ | expand \
| sed -r 's/([[:digit:]]):/\1:@@ /' \ | sed -r 's/([[:digit:]]):/\1:@@ /' \
| tr -s ' ' \ | tr -s ' ' \

Loading…
Cancel
Save