Compare commits

..

3 Commits

Author SHA1 Message Date
Ingo Karkat
7b91d41c66 Add hint for OR'ing TERMs to help text for ls/list.
The regexp syntax and quoting rules aren't known to many who are not well versed in the Bash shell, and difficult to get right even for people in the know. This question came up just recently on the mailing list, too.
2012-01-07 22:42:56 +01:00
Ingo Karkat
c8e35bbb50 Cosmetics: Correct double-spacing in help text. 2012-01-07 22:23:00 +01:00
Ingo Karkat
c0eb143839 Cosmetics: Consistently use "TERM(s)" in help text.
Two places only used "TERM" although multiple are supported. This can be misleading: do one or all have to match?
2012-01-07 22:22:18 +01:00

17
todo.sh
View File

@@ -199,7 +199,10 @@ help()
list [TERM...]
ls [TERM...]
Displays all tasks that contain TERM(s) sorted by priority with line
numbers. If no TERM specified, lists entire todo.txt.
numbers. Each task must match all TERMs (logical AND); to display
tasks that contain any TERM (logical OR), use
"TERM1\|TERM2\|..." (with quotes), or TERM1\\\|TERM2 (unquoted).
If no TERM specified, lists entire todo.txt.
listall [TERM...]
lsa [TERM...]
@@ -215,7 +218,7 @@ help()
lf [SRC [TERM...]]
Displays all the lines in SRC file located in the todo.txt directory,
sorted by priority with line numbers. If TERM specified, lists
all lines that contain TERM in SRC file.
all lines that contain TERM(s) in SRC file.
Without any arguments, the names of all text files in the todo.txt
directory are listed.
@@ -223,7 +226,7 @@ help()
lsp [PRIORITY] [TERM...]
Displays all tasks prioritized PRIORITY.
If no PRIORITY specified, lists all prioritized tasks.
If TERM specified, lists only prioritized tasks that contain TERM.
If TERM specified, lists only prioritized tasks that contain TERM(s).
listproj
lsprj
@@ -775,12 +778,8 @@ _list() {
fi
items=$(
sed = "$src" \
| sed '''
N
s/^/ /
s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 /
/^[ 0-9]\+ *$/d
'''
| sed "N; s/^/ /; s/ *\(.\{$PADDING,\}\)\n/\1 /" \
| grep -v "^[ 0-9]\+ *$"
)
if [ "${filter_command}" ]; then
filtered_items=$(echo -n "$items" | eval "${filter_command}")