diff --git a/tests/t1250-listpri.sh b/tests/t1250-listpri.sh index ea6b63d..b01ad73 100755 --- a/tests/t1250-listpri.sh +++ b/tests/t1250-listpri.sh @@ -26,4 +26,46 @@ TODO: 0 of 3 tasks shown -- TODO: 1 of 3 tasks shown EOF + +test_todo_session 'listpri highlighting' <>> todo.sh listpri +1 (B) smell the uppercase Roses +flowers @outside +2 (C) notice the sunflowers +-- +TODO: 2 of 3 tasks shown +EOF + +cat > todo.txt <>> todo.sh -p listpri +1 (B) smell the uppercase Roses +flowers @outside +2 (C) notice the sunflowers +-- +TODO: 2 of 5 tasks shown + +>>> todo.sh -p listpri b +1 (B) smell the uppercase Roses +flowers @outside +-- +TODO: 1 of 5 tasks shown + +>>> todo.sh -p listpri c +2 (C) notice the sunflowers +-- +TODO: 1 of 5 tasks shown + +>>> todo.sh -p listpri m +-- +TODO: 0 of 5 tasks shown + +>>> todo.sh -p listpri n +-- +TODO: 0 of 5 tasks shown +EOF + test_done diff --git a/todo.sh b/todo.sh index 6a1caef..f24b638 100755 --- a/todo.sh +++ b/todo.sh @@ -1022,9 +1022,9 @@ note: PRIORITY must a single letter from A to Z." ## No priority specified; show all priority tasks pri="[A-Z]" fi - pri="($pri)" - _list "$TODO_FILE" "$pri" + post_filter_command="grep '^ *[0-9]\+ (${pri}) '" + _list "$TODO_FILE" ;; "move" | "mv" )