diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-10-10 14:12:41 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-10-10 14:12:41 +0000 |
commit | 7b35c8639c5d36cd06df35f432735b0aa29c08cf (patch) | |
tree | 4fc61b84848b2b60994c638929c679bc0a0b6bdb /Completion/Core | |
parent | b9f6bdf162ccdd6b6c644c63a42f993d271ccdce (diff) | |
download | zsh-7b35c8639c5d36cd06df35f432735b0aa29c08cf.tar.gz zsh-7b35c8639c5d36cd06df35f432735b0aa29c08cf.tar.xz zsh-7b35c8639c5d36cd06df35f432735b0aa29c08cf.zip |
*** empty log message ***
Diffstat (limited to 'Completion/Core')
-rw-r--r-- | Completion/Core/_parameters | 21 |
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]}}%%:*}" |