shell: tweak getopts tests, no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-08-13 02:59:00 +02:00
parent 419db0391e
commit 007ce9f807
6 changed files with 34 additions and 4 deletions

View File

@@ -10,6 +10,8 @@
# We check that loop does not stop on unknown option (sets "?"),
# stops on _first_ non-option argument.
(
echo "*** no OPTIND, optstring:'ab' args:-a -b c"
var=QWERTY
while getopts "ab" var -a -b c; do
@@ -73,3 +75,7 @@ while getopts "ab" var -a -c -b d; do
echo "var:'$var' OPTIND:$OPTIND"
done
echo "exited: rc:$? var:'$var' OPTIND:$OPTIND"
) 2>&1 \
| sed -e 's/ unrecognized option: / invalid option -- /' \
-e 's/ illegal option -- / invalid option -- /' \