Pull archive() in-line and delegate via recursive call, also for report.

The report action should delegate to archive; it previously (half) did this via duplicated code (and forgot to defragment empty lines, so the tally could be off, and kept silent about the archiving).

The do action directly invoked archive(); if the user had extended / modified the archive action via an eponymous custom action, it would not run. Therefore, always invoke archive through another call of todo.sh, so that a possible custom action is considered.
This commit is contained in:
Ingo Karkat
2012-01-13 23:46:08 +01:00
parent 6424c4c1a0
commit 1a2af45b4d
2 changed files with 18 additions and 17 deletions

View File

@@ -85,10 +85,12 @@ TODO: $HOME/todo.txt archived.
TODO: 5 of 5 tasks shown
>>> todo.sh report
TODO: $HOME/todo.txt archived.
TODO: Report file updated.
2009-02-13-04:40:00 5 1
>>> todo.sh report
TODO: $HOME/todo.txt archived.
TODO: Report file updated.
2009-02-13-04:40:00 5 1
2009-02-13-04:40:00 5 1