Fix for no arguments causing error (#119)

This commit is contained in:
Jon 2016-10-12 22:51:53 -04:00 committed by Henric Andersson
commit 4c3bca05e5

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=( "$@" )