summaryrefslogtreecommitdiffstats
path: root/Test/Y03arguments.ztst
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2017-01-04 14:50:56 +0100
committerOliver Kiddle <opk@zsh.org>2017-01-04 14:50:56 +0100
commit8be732cbcc248abfa82ee1b4d0031f684e79aa8b (patch)
tree3b48189e1d637fbce77bc2471e6d31b804620228 /Test/Y03arguments.ztst
parent40226: tidy up some of the _arguments set code (diff)
downloadzsh-8be732cbcc248abfa82ee1b4d0031f684e79aa8b.tar
zsh-8be732cbcc248abfa82ee1b4d0031f684e79aa8b.tar.gz
zsh-8be732cbcc248abfa82ee1b4d0031f684e79aa8b.tar.bz2
zsh-8be732cbcc248abfa82ee1b4d0031f684e79aa8b.tar.lz
zsh-8be732cbcc248abfa82ee1b4d0031f684e79aa8b.tar.xz
zsh-8be732cbcc248abfa82ee1b4d0031f684e79aa8b.tar.zst
zsh-8be732cbcc248abfa82ee1b4d0031f684e79aa8b.zip
40227: handle _arguments sets and rest arguments starting with a dash
This is a new approach to the problem first covered by 39611: checking to see if an option-like argument belongs to one of the other sets.
Diffstat (limited to 'Test/Y03arguments.ztst')
-rw-r--r--Test/Y03arguments.ztst16
1 files changed, 7 insertions, 9 deletions
diff --git a/Test/Y03arguments.ztst b/Test/Y03arguments.ztst
index 0b797ac03..47f4747b8 100644
--- a/Test/Y03arguments.ztst
+++ b/Test/Y03arguments.ztst
@@ -358,26 +358,24 @@
0:repeatable options
>line: {tst -v -v }{}
-# necessary to exclude the rest arguments for the other set because
-# it is currently any unknown option rather than options from another
-# set that causes a set to be excluded
tst_arguments -A '-*' - help -h -V - other -a '*: :(-x more)'
comptest $'tst -a -x m\t'
0:continue completion after rest argument that looks like an option (with sets)
->line: {tst -a -x m}{}
-#>line: {tst -a -x more }{}
+>line: {tst -a -x more }{}
tst_arguments - '(help)' -h -V - other -a '*:rest:(1 2 3)'
- comptest $'tst -h \t'
-0:unknown option disables whole set (without -A)
+ comptest $'tst -h \t-a \t'
+0:foreign option disables whole set (without -A)
>line: {tst -h }{}
>MESSAGE:{no arguments}
+>line: {tst -h -a }{}
tst_arguments -A "-*" - '(help)' -h -V - other -a '*:rest:(1 2 3)'
- comptest $'tst -h \t'
-0:unknown option disables whole set (with -A)
+ comptest $'tst -h \t-a \t'
+0:foreign option disables whole set (with -A)
>line: {tst -h }{}
>MESSAGE:{no arguments}
+>line: {tst -h -a }{}
tst_arguments '(-C)-a' - set1 -C -v - set2 '(-a)-C' -w
comptest $'tst -a -\t' $'\C-w\C-w-C -\t'