Skip to content

Commit ef65ee0

Browse files
committed
clean comments
1 parent 0278832 commit ef65ee0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

parseOpts.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,10 @@ _opts_setOptValue() {
104104

105105
for optName in "${idxNameArray[@]:1:${#idxNameArray[@]}}"; do # index from 1, skip mode
106106
[ "$opt" = "$optName" ] && {
107-
# set _OPT_VALUE
108107
for optName2 in "${idxNameArray[@]:1:${#idxNameArray[@]}}"; do
109108
local optValueVarName="_OPT_VALUE_`_opts_convertToVarName "${optName2}"`"
110109
local from='"$value"'
111-
eval "$optValueVarName=$from"
110+
eval "$optValueVarName=$from" # set global var!
112111
done
113112
return
114113
}
@@ -133,7 +132,7 @@ _opts_setOptArray() {
133132
for optName2 in "${idxNameArray[@]:1:${#idxNameArray[@]}}"; do
134133
local optValueVarName="_OPT_VALUE_`_opts_convertToVarName "${optName2}"`"
135134
local from='"$@"'
136-
eval "$optValueVarName=($from)"
135+
eval "$optValueVarName=($from)" # set global var!
137136
done
138137
return
139138
}
@@ -163,7 +162,7 @@ parseOpts() {
163162
local optsDescription="$1" # optsDescription LIKE a,a-long|b,b-long:|c,c-long+
164163
shift
165164

166-
_OPT_INFO_LIST_INDEX=() # Global var
165+
_OPT_INFO_LIST_INDEX=() # set global var!
167166

168167
local optDescLines=`echo "$optsDescription" |
169168
# cut head and tail space
@@ -292,7 +291,7 @@ parseOpts() {
292291
;;
293292
esac
294293
done
295-
_OPT_ARGS=("${args[@]}")
294+
_OPT_ARGS=("${args[@]}") # set global var!
296295
}
297296

298297
#####################################################################

0 commit comments

Comments
 (0)