1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 10:01:11 +02:00

44199: _normal: Use zparseopts

This commit is contained in:
Matthew Martin 2019-04-04 18:45:19 -05:00
parent c749a06bc9
commit bb790c8f81
2 changed files with 9 additions and 8 deletions

View file

@ -1,3 +1,7 @@
2019-04-04 Matthew Martin <phy1729@gmail.com>
* 44199: Completion/Base/Core/_normal: Use zparseopts.
2019-04-01 dana <dana@dana.is>
* 44158 (tweaked): Completion/Unix/Command/_postgresql: Add

View file

@ -1,13 +1,10 @@
#compdef -command-line-
local _comp_command1 _comp_command2 _comp_command skip
local _comp_command1 _comp_command2 _comp_command
local -A opts
if [[ "$1" = -s ]]; then
skip=(-s)
else
skip=()
_compskip=''
fi
zparseopts -A opts -D - s
(( $+opts[-s] )) || _compskip=
# Check for a history reference to complete modifiers.
# $PREFIX has a quoted form of the !, so we can't test that
@ -37,5 +34,5 @@ fi
_set_command
_dispatch "$skip[@]" "$_comp_command" \
_dispatch ${(k)opts[-s]} "$_comp_command" \
"$_comp_command1" "$_comp_command2" -default-