1999-04-15 20:05:38 +02:00
|
|
|
#autoload
|
|
|
|
|
|
|
|
# This should be used to complete parameter names if you need some of the
|
2000-06-22 10:42:36 +02:00
|
|
|
# extra options of compadd. It completes only non-local parameters.
|
1999-04-15 20:05:38 +02:00
|
|
|
|
2000-08-10 23:22:25 +02:00
|
|
|
# If you specify a -g option with a pattern, the pattern will be used to
|
|
|
|
# restrict the type of parameters matched.
|
2000-06-22 10:42:36 +02:00
|
|
|
|
2000-10-10 16:12:41 +02:00
|
|
|
local expl pattern fakes faked tmp
|
2000-08-10 23:22:25 +02:00
|
|
|
|
|
|
|
pattern=(-g \*)
|
|
|
|
zparseopts -D -K -E g:=pattern
|
|
|
|
|
2000-10-10 16:12:41 +02:00
|
|
|
fakes=()
|
|
|
|
faked=()
|
|
|
|
if zstyle -a ":completion:${curcontext}:" fake-parameters tmp; then
|
|
|
|
for i in "$tmp[@]"; do
|
|
|
|
if [[ "$i" = *:* ]]; then
|
|
|
|
faked=( "$faked[@]" "$i" )
|
|
|
|
else
|
|
|
|
fakes=( "$fakes[@]" "$i" )
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
_wanted parameters expl parameter \
|
|
|
|
compadd "$@" -Q - \
|
|
|
|
"${(@k)parameters[(R)${pattern[2]}~*local*]}" \
|
|
|
|
"$fakes[@]" \
|
|
|
|
"${(@)${(@M)faked:#${~pattern[2]}}%%:*}"
|