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