Using die() for some more error messages.
This commit is contained in:
@@ -13,6 +13,7 @@ commands work, including support for filtering.
|
|||||||
test_todo_session 'nonexistant file' <<EOF
|
test_todo_session 'nonexistant file' <<EOF
|
||||||
>>> todo.sh addto garden.txt notice the daisies
|
>>> todo.sh addto garden.txt notice the daisies
|
||||||
TODO: Destination file $HOME/garden.txt does not exist.
|
TODO: Destination file $HOME/garden.txt does not exist.
|
||||||
|
=== 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
touch "$HOME/garden.txt"
|
touch "$HOME/garden.txt"
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ EOF
|
|||||||
test_todo_session 'del nonexistant TERM' <<EOF
|
test_todo_session 'del nonexistant TERM' <<EOF
|
||||||
>>> todo.sh del 1 dung
|
>>> todo.sh del 1 dung
|
||||||
1: (B) smell the uppercase Roses +flowers @outside
|
1: (B) smell the uppercase Roses +flowers @outside
|
||||||
'dung' not found; no removal done.
|
TODO: 'dung' not found; no removal done.
|
||||||
=== 1
|
=== 1
|
||||||
|
|
||||||
>>> todo.sh -p list
|
>>> todo.sh -p list
|
||||||
|
|||||||
9
todo.sh
9
todo.sh
@@ -569,8 +569,7 @@ _list() {
|
|||||||
## Path relative to current working directory
|
## Path relative to current working directory
|
||||||
src="$FILE"
|
src="$FILE"
|
||||||
else
|
else
|
||||||
echo "TODO: File $FILE does not exist."
|
die "TODO: File $FILE does not exist."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Get our search arguments, if any
|
## Get our search arguments, if any
|
||||||
@@ -734,7 +733,7 @@ case $action in
|
|||||||
if [ -f "$dest" ]; then
|
if [ -f "$dest" ]; then
|
||||||
_addto "$dest" "$input"
|
_addto "$dest" "$input"
|
||||||
else
|
else
|
||||||
echo "TODO: Destination file $dest does not exist."
|
die "TODO: Destination file $dest does not exist."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -764,7 +763,7 @@ case $action in
|
|||||||
echo "$item: $newtodo"
|
echo "$item: $newtodo"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "TODO: Error appending task $item."
|
die "TODO: Error appending task $item."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -813,7 +812,7 @@ case $action in
|
|||||||
newtodo=$(sed "$item!d" "$TODO_FILE")
|
newtodo=$(sed "$item!d" "$TODO_FILE")
|
||||||
if [ "$DELETEME" = "$newtodo" ]; then
|
if [ "$DELETEME" = "$newtodo" ]; then
|
||||||
[ $TODOTXT_VERBOSE -gt 0 ] && echo "$item: $DELETEME"
|
[ $TODOTXT_VERBOSE -gt 0 ] && echo "$item: $DELETEME"
|
||||||
die "'$3' not found; no removal done."
|
die "TODO: '$3' not found; no removal done."
|
||||||
fi
|
fi
|
||||||
if [ $TODOTXT_VERBOSE -gt 0 ]; then
|
if [ $TODOTXT_VERBOSE -gt 0 ]; then
|
||||||
echo "$item: $DELETEME"
|
echo "$item: $DELETEME"
|
||||||
|
|||||||
Reference in New Issue
Block a user