Browse Source

todolist: add ugrep

master
Maxim Likhachev 3 years ago
parent
commit
29147eaef3
  1. 10
      scripts/todolist

10
scripts/todolist

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

Loading…
Cancel
Save