Aligned verbose message output of tasks with normal task output.

I.e. removed the colon after the ITEM#. Updated tasks are now listed like the 'todo.sh ls' command does, e.g.
    42 smell the roses
This is in preparation to eventually use a function factored out from _list() for the verbose task output, which would enable coloring in the verbose message and thus align the verbose message output even more with the normal task output.
This commit is contained in:
Ingo Karkat
2010-07-14 18:01:39 +02:00
parent 8a95a66749
commit b383b1f0c5
14 changed files with 118 additions and 118 deletions

View File

@@ -12,7 +12,7 @@ command work, including support for filtering.
#
test_todo_session 'basic add/list' <<EOF
>>> todo.sh add notice the daisies
1: notice the daisies
1 notice the daisies
TODO: 1 added.
>>> todo.sh list
@@ -21,7 +21,7 @@ TODO: 1 added.
TODO: 1 of 1 tasks shown
>>> todo.sh add smell the roses
2: smell the roses
2 smell the roses
TODO: 2 added.
>>> todo.sh list
@@ -48,7 +48,7 @@ EOF
test_todo_session 'case-insensitive filtering' <<EOF
>>> todo.sh add smell the uppercase Roses
3: smell the uppercase Roses
3 smell the uppercase Roses
TODO: 3 added.
>>> todo.sh list roses
@@ -60,7 +60,7 @@ EOF
test_todo_session 'add with &' <<EOF
>>> todo.sh add "dig the garden & water the flowers"
4: dig the garden & water the flowers
4 dig the garden & water the flowers
TODO: 4 added.
>>> todo.sh list

View File

@@ -12,7 +12,7 @@ a date to each item.
#
test_todo_session 'cmd line first day' <<EOF
>>> todo.sh -t add notice the daisies
1: 2009-02-13 notice the daisies
1 2009-02-13 notice the daisies
TODO: 1 added.
>>> todo.sh list
@@ -25,7 +25,7 @@ test_tick
test_todo_session 'cmd line second day' <<EOF
>>> todo.sh -t add smell the roses
2: 2009-02-14 smell the roses
2 2009-02-14 smell the roses
TODO: 2 added.
>>> todo.sh list
@@ -39,7 +39,7 @@ test_tick
test_todo_session 'cmd line third day' <<EOF
>>> todo.sh -t add mow the lawn
3: 2009-02-15 mow the lawn
3 2009-02-15 mow the lawn
TODO: 3 added.
>>> todo.sh list
@@ -58,7 +58,7 @@ test_tick 3600
test_todo_session 'config file third day' <<EOF
>>> todo.sh add take out the trash
4: 2009-02-15 take out the trash
4 2009-02-15 take out the trash
TODO: 4 added.
>>> todo.sh list

View File

@@ -20,7 +20,7 @@ touch "$HOME/garden.txt"
test_todo_session 'basic addto/listfile' <<EOF
>>> todo.sh addto garden.txt notice the daisies
1: notice the daisies
1 notice the daisies
GARDEN: 1 added.
>>> todo.sh listfile garden.txt
@@ -29,7 +29,7 @@ GARDEN: 1 added.
GARDEN: 1 of 1 tasks shown
>>> todo.sh addto garden.txt smell the roses
2: smell the roses
2 smell the roses
GARDEN: 2 added.
>>> todo.sh listfile garden.txt
@@ -56,7 +56,7 @@ EOF
test_todo_session 'case-insensitive filtering' <<EOF
>>> todo.sh addto garden.txt smell the uppercase Roses
3: smell the uppercase Roses
3 smell the uppercase Roses
GARDEN: 3 added.
>>> todo.sh listfile garden.txt roses
@@ -68,7 +68,7 @@ EOF
test_todo_session 'addto with &' <<EOF
>>> todo.sh addto garden.txt "dig the garden & water the flowers"
4: dig the garden & water the flowers
4 dig the garden & water the flowers
GARDEN: 4 added.
>>> todo.sh listfile garden.txt

View File

@@ -14,7 +14,7 @@ touch "$HOME/garden.txt"
#
test_todo_session 'cmd line first day' <<EOF
>>> todo.sh -t addto garden.txt notice the daisies
1: 2009-02-13 notice the daisies
1 2009-02-13 notice the daisies
GARDEN: 1 added.
>>> todo.sh listfile garden.txt
@@ -27,7 +27,7 @@ test_tick
test_todo_session 'cmd line second day' <<EOF
>>> todo.sh -t addto garden.txt smell the roses
2: 2009-02-14 smell the roses
2 2009-02-14 smell the roses
GARDEN: 2 added.
>>> todo.sh listfile garden.txt
@@ -41,7 +41,7 @@ test_tick
test_todo_session 'cmd line third day' <<EOF
>>> todo.sh -t addto garden.txt mow the lawn
3: 2009-02-15 mow the lawn
3 2009-02-15 mow the lawn
GARDEN: 3 added.
>>> todo.sh listfile garden.txt
@@ -60,7 +60,7 @@ test_tick 3600
test_todo_session 'config file third day' <<EOF
>>> todo.sh addto garden.txt take out the trash
4: 2009-02-15 take out the trash
4 2009-02-15 take out the trash
GARDEN: 4 added.
>>> todo.sh listfile garden.txt

View File

@@ -19,9 +19,9 @@ EOF
test_todo_session 'basic replace' <<EOF
>>> todo.sh replace 1 "smell the cows"
1: notice the daisies
1 notice the daisies
TODO: Replaced task with:
1: smell the cows
1 smell the cows
>>> todo.sh list
1 smell the cows
@@ -29,9 +29,9 @@ TODO: Replaced task with:
TODO: 1 of 1 tasks shown
>>> todo.sh replace 1 smell the roses
1: smell the cows
1 smell the cows
TODO: Replaced task with:
1: smell the roses
1 smell the roses
>>> todo.sh list
1 smell the roses
@@ -47,42 +47,42 @@ chase the chickens
EOF
test_todo_session 'replace in multi-item file' <<EOF
>>> todo.sh replace 1 smell the cheese
1: smell the cows
1 smell the cows
TODO: Replaced task with:
1: smell the cheese
1 smell the cheese
>>> todo.sh replace 3 jump on hay
3: thrash some hay
3 thrash some hay
TODO: Replaced task with:
3: jump on hay
3 jump on hay
>>> todo.sh replace 4 collect the eggs
4: chase the chickens
4 chase the chickens
TODO: Replaced task with:
4: collect the eggs
4 collect the eggs
EOF
test_todo_session 'replace with priority' <<EOF
>>> todo.sh pri 4 a
4: (A) collect the eggs
4 (A) collect the eggs
TODO: 4 prioritized (A).
>>> todo.sh replace 4 "collect the bread"
4: (A) collect the eggs
4 (A) collect the eggs
TODO: Replaced task with:
4: (A) collect the bread
4 (A) collect the bread
>>> todo.sh replace 4 collect the eggs
4: (A) collect the bread
4 (A) collect the bread
TODO: Replaced task with:
4: (A) collect the eggs
4 (A) collect the eggs
EOF
test_todo_session 'replace with &' << EOF
>>> todo.sh replace 3 "thrash the hay & thresh the wheat"
3: jump on hay
3 jump on hay
TODO: Replaced task with:
3: thrash the hay & thresh the wheat
3 thrash the hay & thresh the wheat
EOF
test_todo_session 'replace error' << EOF
@@ -94,41 +94,41 @@ EOF
cat /dev/null > todo.txt
test_todo_session 'replace handling prepended date on add' <<EOF
>>> todo.sh -t add "new task"
1: 2009-02-13 new task
1 2009-02-13 new task
TODO: 1 added.
>>> todo.sh replace 1 this is just a new one
1: 2009-02-13 new task
1 2009-02-13 new task
TODO: Replaced task with:
1: 2009-02-13 this is just a new one
1 2009-02-13 this is just a new one
>>> todo.sh replace 1 2010-07-04 this also has a new date
1: 2009-02-13 this is just a new one
1 2009-02-13 this is just a new one
TODO: Replaced task with:
1: 2010-07-04 this also has a new date
1 2010-07-04 this also has a new date
EOF
cat /dev/null > todo.txt
test_todo_session 'replace handling priority and prepended date on add' <<EOF
>>> todo.sh -t add "new task"
1: 2009-02-13 new task
1 2009-02-13 new task
TODO: 1 added.
>>> todo.sh pri 1 A
1: (A) 2009-02-13 new task
1 (A) 2009-02-13 new task
TODO: 1 prioritized (A).
>>> todo.sh replace 1 this is just a new one
1: (A) 2009-02-13 new task
1 (A) 2009-02-13 new task
TODO: Replaced task with:
1: (A) 2009-02-13 this is just a new one
1 (A) 2009-02-13 this is just a new one
EOF
test_todo_session 'replace with prepended date replaces existing date' <<EOF
>>> todo.sh replace 1 2010-07-04 this also has a new date
1: (A) 2009-02-13 this is just a new one
1 (A) 2009-02-13 this is just a new one
TODO: Replaced task with:
1: (A) 2010-07-04 this also has a new date
1 (A) 2010-07-04 this also has a new date
EOF
test_done

View File

@@ -25,7 +25,7 @@ test_todo_session 'basic priority' <<EOF
TODO: 3 of 3 tasks shown
>>> todo.sh pri 1 B
1: (B) smell the uppercase Roses +flowers @outside
1 (B) smell the uppercase Roses +flowers @outside
TODO: 1 prioritized (B).
>>> todo.sh list
@@ -43,7 +43,7 @@ TODO: 3 of 3 tasks shown
TODO: 3 of 3 tasks shown
>>> todo.sh pri 2 C
2: (C) notice the sunflowers
2 (C) notice the sunflowers
TODO: 2 prioritized (C).
>>> todo.sh -p list
@@ -54,7 +54,7 @@ TODO: 2 prioritized (C).
TODO: 3 of 3 tasks shown
>>> todo.sh pri 2 A
2: (A) notice the sunflowers
2 (A) notice the sunflowers
TODO: 2 prioritized (A).
>>> todo.sh -p list
@@ -65,7 +65,7 @@ TODO: 2 prioritized (A).
TODO: 3 of 3 tasks shown
>>> todo.sh pri 2 a
2: (A) notice the sunflowers
2 (A) notice the sunflowers
TODO: 2 prioritized (A).
>>> todo.sh -p listpri
@@ -75,7 +75,7 @@ TODO: 2 prioritized (A).
TODO: 2 of 3 tasks shown
>>> todo.sh add "smell the coffee +wakeup"
4: smell the coffee +wakeup
4 smell the coffee +wakeup
TODO: 4 added.
>>> todo.sh -p list

View File

@@ -31,7 +31,7 @@ TODO: 3 of 3 tasks shown
TODO: 3 of 3 tasks shown
>>> todo.sh prepend 2 test
2: test notice the sunflowers
2 test notice the sunflowers
>>> todo.sh -p list
1 (B) smell the uppercase Roses +flowers @outside
@@ -41,7 +41,7 @@ TODO: 3 of 3 tasks shown
TODO: 3 of 3 tasks shown
>>> todo.sh prepend 1 test
1: (B) test smell the uppercase Roses +flowers @outside
1 (B) test smell the uppercase Roses +flowers @outside
>>> todo.sh -p list
1 (B) test smell the uppercase Roses +flowers @outside
@@ -54,41 +54,41 @@ EOF
test_todo_session 'prepend with &' <<EOF
>>> todo.sh prepend 3 "no running & jumping now"
3: no running & jumping now stop
3 no running & jumping now stop
EOF
cat /dev/null > todo.txt
test_todo_session 'prepend handling prepended date on add' <<EOF
>>> todo.sh -t add "new task"
1: 2009-02-13 new task
1 2009-02-13 new task
TODO: 1 added.
>>> todo.sh prepend 1 "this is just a"
1: 2009-02-13 this is just a new task
1 2009-02-13 this is just a new task
EOF
cat /dev/null > todo.txt
test_todo_session 'prepend handling priority and prepended date on add' <<EOF
>>> todo.sh -t add "new task"
1: 2009-02-13 new task
1 2009-02-13 new task
TODO: 1 added.
>>> todo.sh pri 1 A
1: (A) 2009-02-13 new task
1 (A) 2009-02-13 new task
TODO: 1 prioritized (A).
>>> todo.sh prepend 1 "this is just a"
1: (A) 2009-02-13 this is just a new task
1 (A) 2009-02-13 this is just a new task
EOF
cat /dev/null > todo.txt
test_todo_session 'prepend with prepended date keeps both' <<EOF
>>> todo.sh -t add "new task"
1: 2009-02-13 new task
1 2009-02-13 new task
TODO: 1 added.
>>> todo.sh prepend 1 "2010-07-04 this is just a"
1: 2009-02-13 2010-07-04 this is just a new task
1 2009-02-13 2010-07-04 this is just a new task
EOF
test_done

View File

@@ -41,9 +41,9 @@ test_todo_session 'basic do' <<EOF
TODO: 7 of 7 tasks shown
>>> todo.sh do 7,6
7: x 2009-02-13 remove4
7 x 2009-02-13 remove4
TODO: 7 marked as done.
6: x 2009-02-13 remove3
6 x 2009-02-13 remove3
TODO: 6 marked as done.
x 2009-02-13 remove3
x 2009-02-13 remove4
@@ -59,9 +59,9 @@ TODO: $HOME/todo.txt archived.
TODO: 5 of 5 tasks shown
>>> todo.sh do 5 4
5: x 2009-02-13 remove2
5 x 2009-02-13 remove2
TODO: 5 marked as done.
4: x 2009-02-13 remove1
4 x 2009-02-13 remove1
TODO: 4 marked as done.
x 2009-02-13 remove1
x 2009-02-13 remove2
@@ -77,7 +77,7 @@ EOF
test_todo_session 'fail multiple do attempts' <<EOF
>>> todo.sh -a do 3
3: x 2009-02-13 stop
3 x 2009-02-13 stop
TODO: 3 marked as done.
>>> todo.sh -a do 3

View File

@@ -19,7 +19,7 @@ EOF
test_todo_session 'basic append' <<EOF
>>> todo.sh append 1 "smell the roses"
1: notice the daisies smell the roses
1 notice the daisies smell the roses
>>> todo.sh list
1 notice the daisies smell the roses
@@ -29,7 +29,7 @@ EOF
test_todo_session 'basic append with &' <<EOF
>>> todo.sh append 1 "see the wasps & bees"
1: notice the daisies smell the roses see the wasps & bees
1 notice the daisies smell the roses see the wasps & bees
>>> todo.sh list
1 notice the daisies smell the roses see the wasps & bees
@@ -49,13 +49,13 @@ notice the daisies
EOF
test_todo_session 'append of current sentence' <<EOF
>>> todo.sh append 1 ", lilies and roses"
1: notice the daisies, lilies and roses
1 notice the daisies, lilies and roses
>>> todo.sh append 1 "; see the wasps"
1: notice the daisies, lilies and roses; see the wasps
1 notice the daisies, lilies and roses; see the wasps
>>> todo.sh append 1 "& bees"
1: notice the daisies, lilies and roses; see the wasps & bees
1 notice the daisies, lilies and roses; see the wasps & bees
EOF
cp todo.cfg special-delimiters.cfg
@@ -64,13 +64,13 @@ export SENTENCE_DELIMITERS='*,.:;&'
EOF
test_todo_session 'append of current sentence SENTENCE_DELIMITERS' <<EOF
>>> todo.sh -d special-delimiters.cfg append 1 "&beans"
1: notice the daisies, lilies and roses; see the wasps & bees&beans
1 notice the daisies, lilies and roses; see the wasps & bees&beans
>>> todo.sh -d special-delimiters.cfg append 1 "%foo"
1: notice the daisies, lilies and roses; see the wasps & bees&beans %foo
1 notice the daisies, lilies and roses; see the wasps & bees&beans %foo
>>> todo.sh -d special-delimiters.cfg append 1 "*2"
1: notice the daisies, lilies and roses; see the wasps & bees&beans %foo*2
1 notice the daisies, lilies and roses; see the wasps & bees&beans %foo*2
EOF
test_done

View File

@@ -30,7 +30,7 @@ test_todo_session 'basic depriority' <<EOF
TODO: 3 of 3 tasks shown
>>> todo.sh depri 1
1: smell the uppercase Roses +flowers @outside
1 smell the uppercase Roses +flowers @outside
TODO: 1 deprioritized.
>>> todo.sh -p list
@@ -55,9 +55,9 @@ test_todo_session 'multiple depriority' <<EOF
TODO: 3 of 3 tasks shown
>>> todo.sh depri 3 2
3: stop
3 stop
TODO: 3 deprioritized.
2: notice the sunflowers
2 notice the sunflowers
TODO: 2 deprioritized.
>>> todo.sh -p list

View File

@@ -34,7 +34,7 @@ test_todo_session 'basic del' <<EOF
TODO: 3 of 3 tasks shown
>>> todo.sh -f del 1
1: (B) smell the uppercase Roses +flowers @outside
1 (B) smell the uppercase Roses +flowers @outside
TODO: 1 deleted.
>>> todo.sh -p list
@@ -51,7 +51,7 @@ stop
EOF
test_todo_session 'del preserving line numbers' <<EOF
>>> todo.sh -f del 1
1: (B) smell the uppercase Roses +flowers @outside
1 (B) smell the uppercase Roses +flowers @outside
TODO: 1 deleted.
>>> todo.sh -f del 1
@@ -59,7 +59,7 @@ TODO: 1 deleted.
=== 1
>>> todo.sh add A new task
4: A new task
4 A new task
TODO: 4 added.
>>> todo.sh -p list
@@ -70,11 +70,11 @@ TODO: 4 added.
TODO: 3 of 3 tasks shown
>>> todo.sh -f -n del 2
2: (A) notice the sunflowers
2 (A) notice the sunflowers
TODO: 2 deleted.
>>> todo.sh add Another new task
3: Another new task
3 Another new task
TODO: 3 added.
>>> todo.sh -p list
@@ -99,9 +99,9 @@ test_todo_session 'basic del TERM' <<EOF
TODO: 3 of 3 tasks shown
>>> todo.sh del 1 uppercase
1: (B) smell the uppercase Roses +flowers @outside
1 (B) smell the uppercase Roses +flowers @outside
TODO: Removed 'uppercase' from task.
1: (B) smell the Roses +flowers @outside
1 (B) smell the Roses +flowers @outside
>>> todo.sh -p list
2 (A) notice the sunflowers
@@ -111,24 +111,24 @@ TODO: Removed 'uppercase' from task.
TODO: 3 of 3 tasks shown
>>> todo.sh del 1 "the Roses"
1: (B) smell the Roses +flowers @outside
1 (B) smell the Roses +flowers @outside
TODO: Removed 'the Roses' from task.
1: (B) smell +flowers @outside
1 (B) smell +flowers @outside
>>> todo.sh del 1 m
1: (B) smell +flowers @outside
1 (B) smell +flowers @outside
TODO: Removed 'm' from task.
1: (B) sell +flowers @outside
1 (B) sell +flowers @outside
>>> todo.sh del 1 @outside
1: (B) sell +flowers @outside
1 (B) sell +flowers @outside
TODO: Removed '@outside' from task.
1: (B) sell +flowers
1 (B) sell +flowers
>>> todo.sh del 1 sell
1: (B) sell +flowers
1 (B) sell +flowers
TODO: Removed 'sell' from task.
1: (B) +flowers
1 (B) +flowers
EOF
cat > todo.txt <<EOF
@@ -138,7 +138,7 @@ cat > todo.txt <<EOF
EOF
test_todo_session 'del nonexistant TERM' <<EOF
>>> todo.sh del 1 dung
1: (B) smell the uppercase Roses +flowers @outside
1 (B) smell the uppercase Roses +flowers @outside
TODO: 'dung' not found; no removal done.
=== 1

View File

@@ -6,9 +6,9 @@ test_description='Multi-line functionality'
## Replace test
# Create the expected file
echo "1: smell the cheese
echo "1 smell the cheese
TODO: Replaced task with:
1: eat apples eat oranges drink milk">$HOME/expect.multi
1 eat apples eat oranges drink milk">$HOME/expect.multi
test_expect_success 'multiline squash item replace' '
(
@@ -33,7 +33,7 @@ fi
## Add test
# Create the expected file
echo "2: eat apples eat oranges drink milk
echo "2 eat apples eat oranges drink milk
TODO: 2 added.">$HOME/expect.multi
test_expect_success 'multiline squash item add' '
@@ -59,7 +59,7 @@ fi
## Append test
# Create the expected file
echo "1: smell the cheese eat apples eat oranges drink milk">$HOME/expect.multi
echo "1 smell the cheese eat apples eat oranges drink milk">$HOME/expect.multi
test_expect_success 'multiline squash item append' '
(
@@ -84,7 +84,7 @@ fi
## Prepend test
# Create the expected file
echo "1: eat apples eat oranges drink milk smell the cheese">$HOME/expect.multi
echo "1 eat apples eat oranges drink milk smell the cheese">$HOME/expect.multi
test_expect_success 'multiline squash item prepend' '
(
@@ -109,11 +109,11 @@ fi
## Multiple line addition
# Create the expected file
echo "2: eat apples
echo "2 eat apples
TODO: 2 added." > $HOME/expect.multi
echo "3: eat oranges
echo "3 eat oranges
TODO: 3 added." >>$HOME/expect.multi
echo "4: drink milk
echo "4 drink milk
TODO: 4 added." >> $HOME/expect.multi
test_expect_success 'actual multiline add' '

View File

@@ -36,7 +36,7 @@ TODO: 2 of 4 tasks shown
TODO: 1 of 4 tasks shown
>>> todo.sh -a do 2
2: x 2009-02-13 notice the sunflowers
2 x 2009-02-13 notice the sunflowers
TODO: 2 marked as done.
>>> todo.sh -p list
@@ -48,7 +48,7 @@ TODO: 2 marked as done.
TODO: 4 of 4 tasks shown
>>> todo.sh add "make the coffee +wakeup"
5: make the coffee +wakeup
5 make the coffee +wakeup
TODO: 5 added.
>>> todo.sh -p list coffee
@@ -58,7 +58,7 @@ TODO: 5 added.
TODO: 2 of 5 tasks shown
>>> todo.sh add "visit http://example.com"
6: visit http://example.com
6 visit http://example.com
TODO: 6 added.
>>> todo.sh -p list
@@ -98,7 +98,7 @@ usage: todo.sh append ITEM# "TEXT TO APPEND"
=== 1
>>> todo.sh append 2 and think
2: stop and think
2 stop and think
>>> todo.sh -p list
1 (B) smell the uppercase Roses +flowers @outside
@@ -136,7 +136,7 @@ TODO: 5 of 5 tasks shown
TODO: 5 of 5 tasks shown
>>> todo.sh add "the coffee +wakeup"
6: the coffee +wakeup
6 the coffee +wakeup
TODO: 6 added.
>>> todo.sh -p list
@@ -150,7 +150,7 @@ TODO: 6 added.
TODO: 6 of 6 tasks shown
>>> todo.sh prepend 6 "make"
6: make the coffee +wakeup
6 make the coffee +wakeup
>>> todo.sh -p list
1 (B) smell the uppercase Roses +flowers @outside