OSDN Git Service

[fix] : Fixed argument parsing
authorhayao <hayao@fascode.net>
Fri, 9 Apr 2021 12:01:34 +0000 (21:01 +0900)
committerhayao <hayao@fascode.net>
Fri, 9 Apr 2021 12:01:34 +0000 (21:01 +0900)
tools/fullbuild.sh

index 9221175..bac511a 100755 (executable)
@@ -141,14 +141,14 @@ _help() {
 share_options+=("--noconfirm")
 
 # Parse options
-ARGUMENT="${@}"
+ARGUMENT=("${@}")
 OPTS="a:dghr:sctm:l:w:"
 OPTL="help,remove-cache"
-if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- ${ARGUMENT}); then
+if ! OPT=$(getopt -o ${OPTS} -l ${OPTL} -- "${ARGUMENT[@]}"); then
     exit 1
 fi
 eval set -- "${OPT}"
-unset OPT OPTS OPTL
+unset OPT OPTS OPTL ARGUMENT
 
 while true; do
     case ${1} in