Use die() / print to stderr for error conditions
To indicate that something went wrong (e.g. the task already was unprioritized). Note: For actions that handle multiple ITEMs in a loop, we cannot use die() as that would abort processing of any following ITEM(s). Instead, use a status variable and set it to 1 on error, then exit at the end.
This commit is contained in:
@@ -60,6 +60,7 @@ test_todo_session 'del with confirmation' <<EOF
|
||||
TODO: 3 of 3 tasks shown
|
||||
|
||||
>>> printf n | todo.sh del 1
|
||||
=== 1
|
||||
Delete '(B) smell the uppercase Roses +flowers @outside'? (y/n)$SPACE
|
||||
TODO: No tasks were deleted.
|
||||
|
||||
@@ -71,10 +72,12 @@ TODO: No tasks were deleted.
|
||||
TODO: 3 of 3 tasks shown
|
||||
|
||||
>>> printf x | todo.sh del 1
|
||||
=== 1
|
||||
Delete '(B) smell the uppercase Roses +flowers @outside'? (y/n)$SPACE
|
||||
TODO: No tasks were deleted.
|
||||
|
||||
>>> echo | todo.sh del 1
|
||||
=== 1
|
||||
Delete '(B) smell the uppercase Roses +flowers @outside'? (y/n)$SPACE
|
||||
TODO: No tasks were deleted.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user