diff --git a/tests/t1260-listprj.sh b/tests/t1260-listprj.sh new file mode 100755 index 0000000..b3e0635 --- /dev/null +++ b/tests/t1260-listprj.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +test_description='list project functionality +' +. ./test-lib.sh + +cat > todo.txt <>> todo.sh listproj ++roses ++sunflowers +EOF + +test_todo_session 'listproj with context' <>> todo.sh listproj @garden ++sunflowers +EOF + +test_done diff --git a/todo.sh b/todo.sh index a21356e..4b87d0b 100755 --- a/todo.sh +++ b/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" )