labs: fix getopts use in osbash.sh
For invalid options, $opt contains a literal '?' rather than the option itself. This patch disables the builtin error message, which gets us the invalid option passed as OPTARG. Change-Id: I3b0d3d85e6c95f1839eed19679bf4d8af378cc29
This commit is contained in:
parent
e67ada9739
commit
e876d266b9
@ -54,7 +54,7 @@ function print_config {
|
||||
echo "VM access method: $VM_ACCESS"
|
||||
}
|
||||
|
||||
while getopts efhnw opt; do
|
||||
while getopts :efhnw opt; do
|
||||
case $opt in
|
||||
e)
|
||||
EXPORT_OVA=$IMG_DIR/oslabs-$DISTRO.ova
|
||||
@ -74,7 +74,7 @@ while getopts efhnw opt; do
|
||||
source "$LIB_DIR/wbatch/batch_for_windows"
|
||||
;;
|
||||
?)
|
||||
echo "Error: unhandled option $opt"
|
||||
echo "Error: invalid option -$OPTARG"
|
||||
echo
|
||||
usage
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user