fix: properly handle argument parsing when skip is set to true
Previously, using the --app flag would mean that we would stop properly parsing all proceeding flags, so the --app flag would only work when set last.
This commit is contained in:
1 parent
9272e40178
commit
594b41cc70
1 file changed
+7
-2
@@ -251,7 +251,12 @@ parse_args() {
|
|||||||
declare desc="top-level cli arg parser"
|
declare desc="top-level cli arg parser"
|
||||||
local next_index=1; local skip=false; local args=("$@")
|
local next_index=1; local skip=false; local args=("$@")
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
$skip && skip=false && continue
|
if [[ "$skip" == "true" ]]; then
|
||||||
|
next_index=$(( next_index + 1 ))
|
||||||
|
skip=false
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
--quiet)
|
--quiet)
|
||||||
export DOKKU_QUIET_OUTPUT=1
|
export DOKKU_QUIET_OUTPUT=1
|
||||||
@@ -272,7 +277,7 @@ parse_args() {
|
|||||||
export DOKKU_APP_NAME=${args[$next_index]}; skip=true
|
export DOKKU_APP_NAME=${args[$next_index]}; skip=true
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
local next_index=$(( next_index + 1 ))
|
next_index=$(( next_index + 1 ))
|
||||||
done
|
done
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user