DisplayError can now use an optional exit code to quit the program

This commit is contained in:
Michael Boelen 2016-07-31 11:46:41 +02:00
parent f436a59c5f
commit 8ee6cb42a3
1 changed files with 5 additions and 1 deletions

View File

@ -533,13 +533,17 @@
# Name : DisplayError()
# Description : Show error on screen
#
# Input : $1 = text (string)
# Input : $1 = text (string), $2 = optional exit code (integer)
# Returns : <nothing>
################################################################################
DisplayError() {
EXITCODE=""
if [ $# -gt 1 ]; then EXITCODE=$2; fi
${ECHOCMD} ""
${ECHOCMD} "${WARNING}Error${NORMAL}: ${BOLD}$1${NORMAL}"
${ECHOCMD} ""
if [ ! -z "${EXITCODE}" ]; then ExitCustom ${EXITCODE}; fi
}