Printing usage message if no ITEM# given to "todo.sh do".
This commit is contained in:
@@ -12,6 +12,12 @@ usage: todo.sh do ITEM#[, ITEM#, ITEM#, ...]
|
|||||||
=== 1
|
=== 1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
test_todo_session 'do missing ITEM#' <<EOF
|
||||||
|
>>> todo.sh do
|
||||||
|
usage: todo.sh do ITEM#[, ITEM#, ITEM#, ...]
|
||||||
|
=== 1
|
||||||
|
EOF
|
||||||
|
|
||||||
cat > todo.txt <<EOF
|
cat > todo.txt <<EOF
|
||||||
smell the uppercase Roses +flowers @outside
|
smell the uppercase Roses +flowers @outside
|
||||||
notice the sunflowers
|
notice the sunflowers
|
||||||
|
|||||||
1
todo.sh
1
todo.sh
@@ -768,6 +768,7 @@ case $action in
|
|||||||
errmsg="usage: $TODO_SH do ITEM#[, ITEM#, ITEM#, ...]"
|
errmsg="usage: $TODO_SH do ITEM#[, ITEM#, ITEM#, ...]"
|
||||||
# shift so we get arguments to the do request
|
# shift so we get arguments to the do request
|
||||||
shift;
|
shift;
|
||||||
|
[ "$#" -eq 0 ] && die "$errmsg"
|
||||||
|
|
||||||
# Split multiple do's, if comma seperated change to whitespace sepereated
|
# Split multiple do's, if comma seperated change to whitespace sepereated
|
||||||
# Loop the 'do' function for each item
|
# Loop the 'do' function for each item
|
||||||
|
|||||||
Reference in New Issue
Block a user