commit f625f6100d27ca9df98d4b67231bcf9398af61d1 from: Paul W. Rankin date: Sat Oct 05 06:39:14 2024 UTC t_done.sh: add -S whole word option commit - 53e7b9ead19bcfde25df0973791c9e3b41749140 commit + f625f6100d27ca9df98d4b67231bcf9398af61d1 blob - 4621c472dcf21631f253c6209273477d4f9bc33b blob + 26a030d8af33171ec042d1e99dd4308860f2119d --- t_done.sh +++ t_done.sh @@ -71,7 +71,7 @@ t_read() { query="$*" casematch= expr "$query" : '\(.*[A-Z].*\)' > /dev/null || casematch='-i' - todo_list=$(grep $casematch "$re_prefix.*$*" "$todo_file") + todo_list=$(grep $wholeword $casematch "$re_prefix.*$*" "$todo_file") if [ -n "$todo_list" ]; then due_list=$(echo "$todo_list" | grep "$re_date") @@ -173,7 +173,7 @@ t_openurl() { t_select "$1" | grep -Eo "https?://[^ ]+" | xargs open } -while getopts ':ab:Dd:ehk:ns:Tz:' opt; do +while getopts ':ab:Dd:ehk:nSs:Tz:' opt; do case $opt in (h) usage ;; (a) showall=0;; @@ -183,6 +183,7 @@ while getopts ':ab:Dd:ehk:ns:Tz:' opt; do (e) ${EDITOR:-vi} "$todo_file"; exit 0;; (k) kill=$OPTARG;; (n) export=0;; + (S) wholeword=-w;; (s) query=$OPTARG;; (T) due=" $(date +%F)";; (z) toggle=$OPTARG;;