diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2004-04-17 21:07:16 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2004-04-17 21:07:16 +0000 |
commit | 53b0a922a2f7132b7b177836c181e34d95a22fd4 (patch) | |
tree | 6cdec9dc473ea823d6726ca3016a086d721871a4 /Completion/Zsh/Command/_zcompile | |
parent | 9b32c65e4922d6bcc3e886b0f869986ca02e91dc (diff) | |
download | zsh-53b0a922a2f7132b7b177836c181e34d95a22fd4.tar.gz zsh-53b0a922a2f7132b7b177836c181e34d95a22fd4.tar.xz zsh-53b0a922a2f7132b7b177836c181e34d95a22fd4.zip |
19790: complete functions after -a and allow multiple -z/-k options
Diffstat (limited to 'Completion/Zsh/Command/_zcompile')
-rw-r--r-- | Completion/Zsh/Command/_zcompile | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Completion/Zsh/Command/_zcompile b/Completion/Zsh/Command/_zcompile index 2d8e6d033..727ead3b1 100644 --- a/Completion/Zsh/Command/_zcompile +++ b/Completion/Zsh/Command/_zcompile @@ -3,23 +3,26 @@ local state line expl curcontext="$curcontext" ret=1 typeset -A opt_args -_arguments -C -s -A "-*" -S \ - '(-t -c -m -a)-U[don'\''t expand aliases]' \ - '(-t -M)-R[mark as read]' \ - '(-t -R)-M[mark as mapped]' \ - '(-t -c -z -m -a)-k[ksh-style autoloading]' \ - '(-t -c -k -m -a)-z[zsh-style autoloading]' \ - '(-t -U -z -k)-c[currently defined functions]' \ - '(-t -U -z -k)-m[use names as patterns]' \ - '(-t -U -z -k)-a[write autoload functions]' \ - '(-M -R -U -z -k -a -c -m)-t[show table of contents]' \ - ':zwc file:_files' \ - '*:function:->function' && ret=0 +_arguments -C -s \ + "(-t -c -m -a)-U[don't expand aliases]" \ + '(-t -M)-R[mark as read]' \ + '(-t -R)-M[mark as mapped]' \ + '(-t -c -m -a)*-k[ksh-style autoloading]' \ + '(-t -c -m -a)*-z[zsh-style autoloading]' \ + '(-t -U -z -k)-c[currently defined functions]' \ + '(-t -U -z -k)-m[use names as patterns]' \ + '(-t -U -z -k)-a[write autoload functions]' \ + '(-M -R -U -z -k -a -c -m)-t[show table of contents]' \ + '(-M -R -U -a -c -m -t):file:->file' \ + '*:function:->function' && ret=0 -if (( $+opt_args[-c] )); then +if [[ $state = function && -n $opt_args[(i)-[ac]] ]]; then _wanted functions expl 'function to write' compadd -k functions && ret=0 +elif [[ -n $opt_args[(i)-[tca]] ]]; then + _description files expl 'zwc file' + _files -g '*.zwc(-.)' "$expl[@]" && ret=0 else - _description files expl 'zsh source file' + _description files expl 'file' _files "$expl[@]" && ret=0 fi |