Fix for no arguments causing error

This commit is contained in:
Jon Shaulis 2016-10-12 18:20:57 -04:00
commit 1e758750cf

View file

@ -156,6 +156,7 @@ trimQuotes() {
echo $__buffer echo $__buffer
} }
if [ ! $# -eq 0 ]; then
HASCFG="${@: -1}" HASCFG="${@: -1}"
if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config" ]; then if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config" ]; then
if [ -f "${HASCFG}" ]; then if [ -f "${HASCFG}" ]; then
@ -163,6 +164,7 @@ if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config"
CONFIGFILE=${HASCFG} CONFIGFILE=${HASCFG}
fi fi
fi fi
fi
# Parse commandline # Parse commandline
ALLARGS=( "$@" ) ALLARGS=( "$@" )