1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-30 05:40:58 +01:00

add -g option to _parameters to restrict type of parameters completed (12583)

This commit is contained in:
Oliver Kiddle 2000-08-10 21:22:25 +00:00
parent 5b04efd73c
commit 5851a32681
6 changed files with 32 additions and 12 deletions

View file

@ -3,6 +3,13 @@
# This should be used to complete parameter names if you need some of the
# extra options of compadd. It completes only non-local parameters.
local expl
# If you specify a -g option with a pattern, the pattern will be used to
# restrict the type of parameters matched.
_wanted parameters expl parameter compadd "$@" -k 'parameters[(R)^*local*]'
local expl pattern
pattern=(-g \*)
zparseopts -D -K -E g:=pattern
_wanted parameters expl parameter compadd "$@" \
-k "parameters[(R)${pattern[2]}~*local*]"