summaryrefslogtreecommitdiff
path: root/Completion/Core/_parameters
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Core/_parameters')
-rw-r--r--Completion/Core/_parameters21
1 files changed, 18 insertions, 3 deletions
diff --git a/Completion/Core/_parameters b/Completion/Core/_parameters
index b49d60dda..097a96760 100644
--- a/Completion/Core/_parameters
+++ b/Completion/Core/_parameters
@@ -6,10 +6,25 @@
# If you specify a -g option with a pattern, the pattern will be used to
# restrict the type of parameters matched.
-local expl pattern
+local expl pattern fakes faked tmp
pattern=(-g \*)
zparseopts -D -K -E g:=pattern
-_wanted parameters expl parameter compadd "$@" \
- -Q -k "parameters[(R)${pattern[2]}~*local*]"
+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]}}%%:*}"