fix: remove -E from zparseopts (#433)

* fix: remove -E from zparseopts

this fix following bugs:

_tst() {
  compadd -J packages -X package openpgp-keys-gentoo-release -MERGING-pnpm-bin
}
compdef _tst tst

* fix: tests
This commit is contained in:
Aloxaf 2024-04-26 10:50:24 +08:00 committed by GitHub
parent cf3c151d33
commit c7fb028ec0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -14,9 +14,9 @@ builtin unalias -m '[^+]*'
# parse all options
local -A apre hpre dscrs _oad _mesg
local -a isfile _opts __ expl
zparseopts -E -a _opts P:=apre p:=hpre d:=dscrs X+:=expl O:=_oad A:=_oad D:=_oad f=isfile \
zparseopts -a _opts P:=apre p:=hpre d:=dscrs X+:=expl O:=_oad A:=_oad D:=_oad f=isfile \
i: S: s: I: x:=_mesg r: R: W: F: M+: E: q e Q n U C \
J:=__ V:=__ a=__ l=__ k=__ o=__ 1=__ 2=__
J:=__ V:=__ a=__ l=__ k=__ o::=__ 1=__ 2=__
# store $curcontext for further usage
_ftb_curcontext=${curcontext#:}

View file

@ -230,6 +230,14 @@
>C1:{prefix_2}
>C1:{prenofix_3}
comptesteval '_tst() { compadd -J packages -X package openpgp-keys-gentoo-release -MERGING-pnpm-bin }'
comptest $'tst \t'
0:completions starts with dash
>line: {tst }{}
>QUERY:{}
>C1:{package }
>C1:{openpgp-keys-gentoo-release}
>C1:{-MERGING-pnpm-bin}
%clean
zmodload -ui zsh/zpty