ENH: listall doesn't simply use concatenated task lists.
The simplistic "listall" action implementation just uses _list() on the concatenation of active and done task lists. This has the following shortcomings: - Task numbers shown for archived tasks from done.txt are invalid. - As the number of done tasks likely greatly outnumbers the number of active tasks, the task number padding is often larger than expected (e.g. 0005 instead of 05). - Verbose output lists all tasks as originating from TODO, whereas it should differentiate between TODO: and DONE: sources. The main challenge is to keep processing all tasks through a single pass of _list(), so that there is a single, unified sorting applied to all tasks. A custom AWK script sets all (originally invalid) task numbers from done.txt to "0", meaning "archived task". The verbose message from _list() is replaced with a custom message that shows the tasks from todo.txt, done.txt, and totals. Oh, and added tests for the previously untested "listall" action.
This commit is contained in:
@@ -45,6 +45,8 @@ test_expect_success 'null listpri a' '
|
||||
cat > expect <<EOF
|
||||
--
|
||||
TODO: 0 of 0 tasks shown
|
||||
DONE: 0 of 0 tasks shown
|
||||
total 0 of 0 tasks shown
|
||||
EOF
|
||||
|
||||
test_expect_success 'null lsa' '
|
||||
|
||||
Reference in New Issue
Block a user