From 77c1f34609070135143f29395edc647a2d308311 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Sat, 13 Mar 2021 20:32:40 +0100 Subject: [PATCH] Documentation: Clarify basic regexp syntax of TERM in todo.sh list (#335) * Documentation: Clarify basic regexp syntax of TERM in todo.sh list And give hints about escaping. Issue raised by https://github.com/todotxt/todo.txt-cli/discussions/334 * Documentation: Correct quoting in todo.sh help list Though the double quoting doesn't do harm when the single backslash is followed by the | character (\| is no valid escape sequence), it's technically more correct to use single quotes, and also is more in line with the quoting advice given directly below it. --- todo.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/todo.sh b/todo.sh index c7d8564..11687d2 100755 --- a/todo.sh +++ b/todo.sh @@ -217,9 +217,13 @@ actionsHelp() Displays all tasks that contain TERM(s) sorted by priority with line numbers. Each task must match all TERM(s) (logical AND); to display tasks that contain any TERM (logical OR), use - "TERM1\|TERM2\|..." (with quotes), or TERM1\\\|TERM2 (unquoted). + 'TERM1\|TERM2\|...' (with quotes), or TERM1\\\|TERM2 (unquoted). Hides all tasks that contain TERM(s) preceded by a - minus sign (i.e. -TERM). If no TERM specified, lists entire todo.txt. + minus sign (i.e. -TERM). + TERM(s) are grep-style basic regular expressions; for literal matching, + put a single backslash before any [ ] \ $ * . ^ and enclose the entire + TERM in single quotes, or use double backslashes and extra shell-quoting. + If no TERM specified, lists entire todo.txt. listall [TERM...] lsa [TERM...]