summaryrefslogtreecommitdiffstats
path: root/Test
diff options
context:
space:
mode:
authordana <dana@dana.is>2026-04-29 23:26:11 -0500
committerdana <dana@dana.is>2026-04-29 23:26:37 -0500
commit028d7b6e2487248f9a3ea11679e5a6363b5849a0 (patch)
treeb28733f798d4a7008656355edcfa351d822bd292 /Test
parent54395: contrib: add zgetopt (again) (diff)
downloadzsh-028d7b6e2487248f9a3ea11679e5a6363b5849a0.tar
zsh-028d7b6e2487248f9a3ea11679e5a6363b5849a0.tar.gz
zsh-028d7b6e2487248f9a3ea11679e5a6363b5849a0.tar.bz2
zsh-028d7b6e2487248f9a3ea11679e5a6363b5849a0.tar.lz
zsh-028d7b6e2487248f9a3ea11679e5a6363b5849a0.tar.xz
zsh-028d7b6e2487248f9a3ea11679e5a6363b5849a0.tar.zst
zsh-028d7b6e2487248f9a3ea11679e5a6363b5849a0.zip
54381: zparseopts -M: use last as-given option name in arrays
Diffstat (limited to 'Test')
-rw-r--r--Test/V12zparseopts.ztst11
1 files changed, 9 insertions, 2 deletions
diff --git a/Test/V12zparseopts.ztst b/Test/V12zparseopts.ztst
index 6a880b49c..17b0a01d2 100644
--- a/Test/V12zparseopts.ztst
+++ b/Test/V12zparseopts.ztst
@@ -127,13 +127,20 @@
>ret: 0, opts: -a '' -b 1 -z '', argv: 1 2 3
>ret: 0, opts: -b 1 -z '', argv: 1 2 3
- () {
+ fn() {
local -a optv
local -A opts
zparseopts -D -M -a optv -A opts - a:=-aaa -aaa:
print -r - ret: $?, optv: $optv, opts: "$( order_assoc opts )", argv: $argv
- } --aaa foo -a bar 1 2 3
+ }
+ fn -a foo 1 2 3
+ fn --aaa foo 1 2 3
+ fn --aaa foo -a bar 1 2 3
+ fn -a foo --aaa bar 1 2 3
0:zparseopts -M
+>ret: 0, optv: -a foo, opts: --aaa foo, argv: 1 2 3
+>ret: 0, optv: --aaa foo, opts: --aaa foo, argv: 1 2 3
+>ret: 0, optv: -a bar, opts: --aaa bar, argv: 1 2 3
>ret: 0, optv: --aaa bar, opts: --aaa bar, argv: 1 2 3
() {