Accept filters for lsprj
This commit is contained in:
23
tests/t1260-listprj.sh
Executable file
23
tests/t1260-listprj.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
test_description='list project functionality
|
||||
'
|
||||
. ./test-lib.sh
|
||||
|
||||
cat > todo.txt <<EOF
|
||||
(B) smell the uppercase Roses +roses @outside
|
||||
(C) notice the sunflowers +sunflowers @garden
|
||||
stop
|
||||
EOF
|
||||
test_todo_session 'basic listproj' <<EOF
|
||||
>>> todo.sh listproj
|
||||
+roses
|
||||
+sunflowers
|
||||
EOF
|
||||
|
||||
test_todo_session 'listproj with context' <<EOF
|
||||
>>> todo.sh listproj @garden
|
||||
+sunflowers
|
||||
EOF
|
||||
|
||||
test_done
|
||||
8
todo.sh
8
todo.sh
@@ -59,7 +59,7 @@ shorthelp()
|
||||
listcon|lsc
|
||||
listfile|lf SRC [TERM...]
|
||||
listpri|lsp [PRIORITY] [TERM...]
|
||||
listproj|lsprj
|
||||
listproj|lsprj [TERM...]
|
||||
move|mv ITEM# DEST [SRC]
|
||||
prepend|prep ITEM# "TEXT TO PREPEND"
|
||||
pri|p ITEM# PRIORITY
|
||||
@@ -1007,7 +1007,11 @@ case $action in
|
||||
;;
|
||||
|
||||
"listproj" | "lsprj" )
|
||||
grep -o '[^ ]*+[^ ]\+' "$TODO_FILE" | grep '^+' | sort -u
|
||||
shift
|
||||
|
||||
export TODOTXT_PLAIN=1
|
||||
_list "$TODO_FILE" "$@" | grep -o '[^ ]*+[^ ]\+' | grep '^+' | \
|
||||
sed "s:\[[0-9;]*[mK]::g" | sort -u
|
||||
;;
|
||||
|
||||
"listpri" | "lsp" )
|
||||
|
||||
Reference in New Issue
Block a user