These options consume arg 2, so we have to compare for greater 1.
Using -gt 0 is too lax as it accepts a missing value, while -gt 2 is too
strict as it rejects when the argument is the last one.
We don't provide a fixes tag, as this pattern was copy-pasted from
an ancient version.
kas-container | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/kas-container b/kas-container
index 8f704f17b..5adf1e507 100755
--- a/kas-container
+++ b/kas-container
@@ -344,12 +344,12 @@ while [ $# -gt 0 ]; do
shift 1
;;
--runtime-args | --docker-args)
- [ $# -gt 0 ] || usage
+ [ $# -gt 1 ] || usage
KAS_EXTRA_RUNTIME_ARGS="${KAS_EXTRA_RUNTIME_ARGS} $2"
shift 2
;;
--ssh-dir)
- [ $# -gt 2 ] || usage
+ [ $# -gt 1 ] || usage
KAS_SSH_DIR="$2"
shift 2
;;
@@ -361,18 +361,18 @@ while [ $# -gt 0 ]; do
shift 1
;;
--aws-dir)
- [ $# -gt 2 ] || usage
+ [ $# -gt 1 ] || usage
KAS_AWS_DIR="$2"
shift 2
;;
--git-credential-store)
- [ $# -gt 2 ] || usage
+ [ $# -gt 1 ] || usage
KAS_GIT_CREDENTIAL_STORE="$2"
shift 2
;;
--git-credential-socket)
- [ $# -gt 2 ] || usage
+ [ $# -gt 1 ] || usage
KAS_GIT_CREDENTIAL_SOCKET="$2"
shift 2
;;
--
2.53.0