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,11 +156,13 @@ trimQuotes() {
echo $__buffer echo $__buffer
} }
HASCFG="${@: -1}" if [ ! $# -eq 0 ]; then
if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config" ]; then HASCFG="${@: -1}"
if [ -f "${HASCFG}" ]; then if [ ! -z "${HASCFG}" -a ! "${HASCFG:0:1}" = "-" -a ! "${@:(-2):1}" = "--config" ]; then
echo "WARNING: Specifying config file as last argument is deprecated. Use --config <path> instead." if [ -f "${HASCFG}" ]; then
CONFIGFILE=${HASCFG} echo "WARNING: Specifying config file as last argument is deprecated. Use --config <path> instead."
CONFIGFILE=${HASCFG}
fi
fi fi
fi fi