6e76445cf7
When getopts finds an invalid option or a missing option-argument, it should not reset its state and should set OPTIND as normal. This is an old ash bug that was fixed long ago in dash. Our behaviour now matches most other shells.
7 lines
76 B
Plaintext
7 lines
76 B
Plaintext
# $FreeBSD$
|
|
|
|
set -- -x
|
|
getopts :x: var
|
|
r=$?
|
|
[ r != 0 ] && [ "$OPTIND" = 2 ]
|