summary refs log tree commit diff
path: root/Test/B10getopts.ztst
diff options
context:
space:
mode:
Diffstat (limited to 'Test/B10getopts.ztst')
-rw-r--r--Test/B10getopts.ztst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/B10getopts.ztst b/Test/B10getopts.ztst
index 7eba5a4b1..72c9e209e 100644
--- a/Test/B10getopts.ztst
+++ b/Test/B10getopts.ztst
@@ -79,3 +79,20 @@
   test_getopts +x
 1:one illegal option, + variant
 >test_getopts:3: bad option: +x
+
+  set -- -x
+  OPTIND=1
+  while getopts x: opt; do
+    echo "$opt,${OPTARG:-Empty}"
+  done
+0:missing option-argument (error message mode)
+>?,Empty
+?(eval):3: argument expected after -x option
+
+  set -- -x
+  OPTIND=1
+  while getopts :x: opt; do
+    echo "$opt,${OPTARG:-Empty}"
+  done
+0:missing option-argument (quiet mode)
+>:,x