@@ -1183,7 +1183,21 @@ builder_parse() {
11831183 fi
11841184
11851185 if [[ $key =~ ^- ]]; then
1186+
1187+ # Expand short -o to --option in options lookup
1188+ if [[ ! -z ${_builder_options_short[$key]+x} ]]; then
1189+ key=${_builder_options_short[$key]}
1190+ fi
1191+
11861192 exp+=($key )
1193+ if [[ ! -z ${_builder_options_var[$key]+x} ]]; then
1194+ shift
1195+ if [[ $# -eq 0 ]]; then
1196+ _builder_parameter_error " $0 " parameter " $key "
1197+ fi
1198+
1199+ exp+=(" $1 " )
1200+ fi
11871201 else
11881202 # Expand comma separated values
11891203 if [[ $key =~ : ]]; then
@@ -1283,10 +1297,6 @@ _builder_parse_expanded_parameters() {
12831297 fi
12841298 n=$(( n + 1 ))
12851299
1286- # Expand short -o to --option in options lookup
1287- if [[ ! -z ${_builder_options_short[$key]+x} ]]; then
1288- key=${_builder_options_short[$key]}
1289- fi
12901300 _builder_item_in_array " $key " " ${_builder_options[@]} " && has_option=1 || has_option=0
12911301
12921302 if (( has_action )) && (( has_target )) ; then
@@ -1315,9 +1325,6 @@ _builder_parse_expanded_parameters() {
13151325 _builder_chosen_options+=(" $key " )
13161326 if [[ ! -z ${_builder_options_var[$key]+x} ]]; then
13171327 shift
1318- if [[ $# -eq 0 ]]; then
1319- _builder_parameter_error " $0 " parameter " $key "
1320- fi
13211328 # Set the variable associated with this option to the next parameter value
13221329 # A little bit of hoop jumping here to avoid issues with cygwin paths being
13231330 # corrupted too early in the game
0 commit comments