status should be optional

This commit is contained in:
belliash 2012-01-12 13:19:53 +01:00
parent 78760a6b63
commit 784a617802
1 changed files with 5 additions and 4 deletions

View File

@ -47,14 +47,15 @@ function checkVersion() {
} }
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Outputs formatted error message and aborts script execution with given code # Outputs formatted error message and aborts script execution with given status
# Parameters: %message% %code% # Parameters: %message% [%status%]
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
function die() { function die() {
notify "${1}" ${2} local STATUS=${2:-1}
notify "${1}" ${STATUS}
printError "${1}" printError "${1}"
echo -ne "\n" echo -ne "\n"
exit ${2} exit ${STATUS}
} }
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------