Showing error on use of invalid arguments

This commit is contained in:
Alex Epstein 2017-07-21 09:46:32 -04:00
parent bcdfd26421
commit 935c92052d
1 changed files with 2 additions and 1 deletions

View File

@ -214,9 +214,10 @@ elif [[ $# == "1" ]];then
exit 0
elif [[ $flag == "clear" || $1 == "clear" ]];then clearAllTasks || exit 1
elif [[ $flag == "get" || $1 == "list" || $1 == "get" ]];then getTasks || exit 1
else { echo "Error: the argument $1 is not valid"; exit 1;}
fi
else
if [[ $flag == "add" || $1 == "add" ]];then addTask "${*:2}" && getTasks|| exit 1
elif [[ $flag == "remove" || $1 == "remove" ]];then removeTask $2 || exit 1
else usage;fi
else { usage; exit 1;};fi
fi