diff options
author | Martijn Dekker <martijn@inlv.org> | 2019-06-29 00:17:42 +0200 |
---|---|---|
committer | Peter Stephenson <p.stephenson@samsung.com> | 2019-07-01 09:42:22 +0100 |
commit | 700ec49581650ea1f0bffacb207a30145e278417 (patch) | |
tree | b5fb684dd667ee80c7b42fee878ed1aae3645d52 /Test | |
parent | 4384fdc7f0b5a1de78af344446fcbb90b7182c9e (diff) | |
download | zsh-700ec49581650ea1f0bffacb207a30145e278417.tar.gz zsh-700ec49581650ea1f0bffacb207a30145e278417.tar.xz zsh-700ec49581650ea1f0bffacb207a30145e278417.zip |
44469: correct error on missing option argument
Diffstat (limited to 'Test')
-rw-r--r-- | Test/B10getopts.ztst | 17 |
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 |