hush: implement "silent" optstrings of ":opts"
[oweals/busybox.git] / shell / hush_test / hush-getopts / getopt_optarg.tests
1 set -- -q -w e -r -t -y
2 echo "*** no OPTIND, optstring:'w:et' args:$*"
3 var=QWERTY
4 OPTARG=ASDFGH
5 while getopts "w:et" var; do
6         echo "var:'$var' OPTIND:$OPTIND OPTARG:'$OPTARG'"
7         OPTARG=ASDFGH
8 done
9 echo "exited: var:'$var' OPTIND:$OPTIND OPTARG:'$OPTARG'"
10
11 set -- -w 1 -w2 -w -e -e -t -t
12 echo "*** OPTIND=0, optstring:'w:et' args:$*"
13 OPTIND=0
14 while getopts "w:et" var; do
15         echo "var:'$var' OPTIND:$OPTIND OPTARG:'$OPTARG'"
16         OPTARG=ASDFGH
17 done
18 echo "exited: var:'$var' OPTIND:$OPTIND OPTARG:'$OPTARG'"