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
}
if [ ! $# -eq 0 ]; then
HASCFG="${@: -1}"
if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config" ]; then
if [ -f "${HASCFG}" ]; then
@ -163,6 +164,7 @@ if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config"
CONFIGFILE=${HASCFG}
fi
fi
fi
# Parse commandline
ALLARGS=( "$@" )