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 @@ @@ -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 ' ' \

Loading…
Cancel
Save