From ba66f66e8654f1d13c8463432560dd59ca533cdd Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Sat, 14 Jan 2012 14:56:03 +0100 Subject: [PATCH] Only print the added report line, not entire report. I think this makes much more sense, especially once the report gets very long. (One can always use "cat" to view the entire report.) --- tests/t9999-testsuite_example.sh | 16 +++++++++++++++- todo.sh | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/t9999-testsuite_example.sh b/tests/t9999-testsuite_example.sh index 9989fa9..18b93da 100755 --- a/tests/t9999-testsuite_example.sh +++ b/tests/t9999-testsuite_example.sh @@ -93,7 +93,6 @@ TODO: Report file updated. 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 >>> todo.sh append g a usage: todo.sh append ITEM# "TEXT TO APPEND" @@ -164,6 +163,21 @@ TODO: 6 of 6 tasks shown -- TODO: 6 of 6 tasks shown +>>> todo.sh -a do 3 +3 x 2009-02-13 smell the coffee +wakeup +TODO: 3 marked as done. + +>>> todo.sh report +x 2009-02-13 smell the coffee +wakeup +TODO: $HOME/todo.txt archived. +TODO: Report file updated. +2009-02-13-04:40:00 5 2 + +>>> todo.sh report +TODO: $HOME/todo.txt archived. +TODO: Report file updated. +2009-02-13-04:40:00 5 2 + >>> todo.sh remdup Usage: todo.sh [-fhpantvV] [-d todo_config] action [task_number] [task_description] Try 'todo.sh -h' for more information. diff --git a/todo.sh b/todo.sh index a9c619e..b8b476f 100755 --- a/todo.sh +++ b/todo.sh @@ -1226,7 +1226,7 @@ note: PRIORITY must be anywhere from A to Z." echo ${TDONE:-0}) echo $TECHO >> "$REPORT_FILE" [ $TODOTXT_VERBOSE -gt 0 ] && echo "TODO: Report file updated." - cat "$REPORT_FILE" + sed -ne '$p' "$REPORT_FILE" ;; "deduplicate" )