summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-getopts/getopt_positional.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2017-08-11 01:32:46 +0200
committerDenys Vlasenko2017-08-11 01:32:46 +0200
commit74d40589288890fffea437ed2f38ad1f2dc740e5 (patch)
treefafc1724b3b2c11280c067eaa4eaabb57e5f34cd /shell/hush_test/hush-getopts/getopt_positional.tests
parent4628945cd8d4679912f126d5f18f954210abb7d0 (diff)
downloadbusybox-74d40589288890fffea437ed2f38ad1f2dc740e5.zip
busybox-74d40589288890fffea437ed2f38ad1f2dc740e5.tar.gz
hush: getopts builtin
function old new delta builtin_getopts - 271 +271 bltins1 372 384 +12 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 283/0) Total: 283 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-getopts/getopt_positional.tests')
-rwxr-xr-xshell/hush_test/hush-getopts/getopt_positional.tests8
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/hush_test/hush-getopts/getopt_positional.tests b/shell/hush_test/hush-getopts/getopt_positional.tests
new file mode 100755
index 0000000..a5404a2
--- /dev/null
+++ b/shell/hush_test/hush-getopts/getopt_positional.tests
@@ -0,0 +1,8 @@
+set -- -q -w -e r -t -y
+echo "*** no OPTIND, optstring:'we' args:$*"
+var=QWERTY
+while getopts "we" var; do
+ echo "var:'$var' OPTIND:$OPTIND"
+done
+# unfortunately, "rc:0" is shown since while's overall exitcode is "success"
+echo "exited: var:'$var' OPTIND:$OPTIND"