Better verbose messages for 'replace' and 'del TERM'.
Added "TODO:" prefix and simplified messages.
This commit is contained in:
@@ -20,7 +20,7 @@ EOF
|
|||||||
test_todo_session 'basic replace' <<EOF
|
test_todo_session 'basic replace' <<EOF
|
||||||
>>> todo.sh replace 1 "smell the cows"
|
>>> todo.sh replace 1 "smell the cows"
|
||||||
1: notice the daisies
|
1: notice the daisies
|
||||||
replaced with
|
TODO: Replaced task with:
|
||||||
1: smell the cows
|
1: smell the cows
|
||||||
|
|
||||||
>>> todo.sh list
|
>>> todo.sh list
|
||||||
@@ -30,7 +30,7 @@ TODO: 1 of 1 tasks shown
|
|||||||
|
|
||||||
>>> todo.sh replace 1 smell the roses
|
>>> todo.sh replace 1 smell the roses
|
||||||
1: smell the cows
|
1: smell the cows
|
||||||
replaced with
|
TODO: Replaced task with:
|
||||||
1: smell the roses
|
1: smell the roses
|
||||||
|
|
||||||
>>> todo.sh list
|
>>> todo.sh list
|
||||||
@@ -48,17 +48,17 @@ EOF
|
|||||||
test_todo_session 'replace in multi-item file' <<EOF
|
test_todo_session 'replace in multi-item file' <<EOF
|
||||||
>>> todo.sh replace 1 smell the cheese
|
>>> todo.sh replace 1 smell the cheese
|
||||||
1: smell the cows
|
1: smell the cows
|
||||||
replaced with
|
TODO: Replaced task with:
|
||||||
1: smell the cheese
|
1: smell the cheese
|
||||||
|
|
||||||
>>> todo.sh replace 3 jump on hay
|
>>> todo.sh replace 3 jump on hay
|
||||||
3: thrash some hay
|
3: thrash some hay
|
||||||
replaced with
|
TODO: Replaced task with:
|
||||||
3: jump on hay
|
3: jump on hay
|
||||||
|
|
||||||
>>> todo.sh replace 4 collect the eggs
|
>>> todo.sh replace 4 collect the eggs
|
||||||
4: chase the chickens
|
4: chase the chickens
|
||||||
replaced with
|
TODO: Replaced task with:
|
||||||
4: collect the eggs
|
4: collect the eggs
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -69,19 +69,19 @@ TODO: 4 prioritized (A).
|
|||||||
|
|
||||||
>>> todo.sh replace 4 "collect the bread"
|
>>> todo.sh replace 4 "collect the bread"
|
||||||
4: (A) collect the eggs
|
4: (A) collect the eggs
|
||||||
replaced with
|
TODO: Replaced task with:
|
||||||
4: (A) collect the bread
|
4: (A) collect the bread
|
||||||
|
|
||||||
>>> todo.sh replace 4 collect the eggs
|
>>> todo.sh replace 4 collect the eggs
|
||||||
4: (A) collect the bread
|
4: (A) collect the bread
|
||||||
replaced with
|
TODO: Replaced task with:
|
||||||
4: (A) collect the eggs
|
4: (A) collect the eggs
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_todo_session 'replace with &' << EOF
|
test_todo_session 'replace with &' << EOF
|
||||||
>>> todo.sh replace 3 "thrash the hay & thresh the wheat"
|
>>> todo.sh replace 3 "thrash the hay & thresh the wheat"
|
||||||
3: jump on hay
|
3: jump on hay
|
||||||
replaced with
|
TODO: Replaced task with:
|
||||||
3: thrash the hay & thresh the wheat
|
3: thrash the hay & thresh the wheat
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@@ -99,12 +99,12 @@ TODO: 1 added.
|
|||||||
|
|
||||||
>>> todo.sh replace 1 this is just a new one
|
>>> todo.sh replace 1 this is just a new one
|
||||||
1: 2009-02-13 new task
|
1: 2009-02-13 new task
|
||||||
replaced with
|
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
|
>>> 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
|
||||||
replaced with
|
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
|
EOF
|
||||||
|
|
||||||
@@ -120,14 +120,14 @@ TODO: 1 prioritized (A).
|
|||||||
|
|
||||||
>>> todo.sh replace 1 this is just a new one
|
>>> todo.sh replace 1 this is just a new one
|
||||||
1: (A) 2009-02-13 new task
|
1: (A) 2009-02-13 new task
|
||||||
replaced with
|
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
|
EOF
|
||||||
|
|
||||||
test_todo_session 'replace with prepended date replaces existing date' <<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
|
>>> 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
|
||||||
replaced with
|
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
|
EOF
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ TODO: 3 of 3 tasks shown
|
|||||||
|
|
||||||
>>> todo.sh del 1 uppercase
|
>>> todo.sh del 1 uppercase
|
||||||
1: (B) smell the uppercase Roses +flowers @outside
|
1: (B) smell the uppercase Roses +flowers @outside
|
||||||
got 'uppercase' removed to become
|
TODO: Removed 'uppercase' from task.
|
||||||
1: (B) smell the Roses +flowers @outside
|
1: (B) smell the Roses +flowers @outside
|
||||||
|
|
||||||
>>> todo.sh -p list
|
>>> todo.sh -p list
|
||||||
@@ -112,22 +112,22 @@ TODO: 3 of 3 tasks shown
|
|||||||
|
|
||||||
>>> todo.sh del 1 "the Roses"
|
>>> todo.sh del 1 "the Roses"
|
||||||
1: (B) smell the Roses +flowers @outside
|
1: (B) smell the Roses +flowers @outside
|
||||||
got 'the Roses' removed to become
|
TODO: Removed 'the Roses' from task.
|
||||||
1: (B) smell +flowers @outside
|
1: (B) smell +flowers @outside
|
||||||
|
|
||||||
>>> todo.sh del 1 m
|
>>> todo.sh del 1 m
|
||||||
1: (B) smell +flowers @outside
|
1: (B) smell +flowers @outside
|
||||||
got 'm' removed to become
|
TODO: Removed 'm' from task.
|
||||||
1: (B) sell +flowers @outside
|
1: (B) sell +flowers @outside
|
||||||
|
|
||||||
>>> todo.sh del 1 @outside
|
>>> todo.sh del 1 @outside
|
||||||
1: (B) sell +flowers @outside
|
1: (B) sell +flowers @outside
|
||||||
got '@outside' removed to become
|
TODO: Removed '@outside' from task.
|
||||||
1: (B) sell +flowers
|
1: (B) sell +flowers
|
||||||
|
|
||||||
>>> todo.sh del 1 sell
|
>>> todo.sh del 1 sell
|
||||||
1: (B) sell +flowers
|
1: (B) sell +flowers
|
||||||
got 'sell' removed to become
|
TODO: Removed 'sell' from task.
|
||||||
1: (B) +flowers
|
1: (B) +flowers
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ test_description='Multi-line functionality'
|
|||||||
## Replace test
|
## Replace test
|
||||||
# Create the expected file
|
# Create the expected file
|
||||||
echo "1: smell the cheese
|
echo "1: smell the cheese
|
||||||
replaced with
|
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' '
|
test_expect_success 'multiline squash item replace' '
|
||||||
|
|||||||
4
todo.sh
4
todo.sh
@@ -333,7 +333,7 @@ replaceOrPrepend()
|
|||||||
case "$action" in
|
case "$action" in
|
||||||
replace)
|
replace)
|
||||||
echo "$item: $todo"
|
echo "$item: $todo"
|
||||||
echo "replaced with"
|
echo "TODO: Replaced task with:"
|
||||||
echo "$item: $newtodo"
|
echo "$item: $newtodo"
|
||||||
;;
|
;;
|
||||||
prepend)
|
prepend)
|
||||||
@@ -817,7 +817,7 @@ case $action in
|
|||||||
fi
|
fi
|
||||||
if [ $TODOTXT_VERBOSE -gt 0 ]; then
|
if [ $TODOTXT_VERBOSE -gt 0 ]; then
|
||||||
echo "$item: $DELETEME"
|
echo "$item: $DELETEME"
|
||||||
echo "got '$3' removed to become"
|
echo "TODO: Removed '$3' from task."
|
||||||
echo "$item: $newtodo"
|
echo "$item: $newtodo"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user