about summary refs log tree commit diff
path: root/Completion/Builtins/_zcompile
blob: c82226dc254f22dc9821f2f76de826cfb77b1c8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#compdef zcompile

local context state line expl
typeset -A opt_args

_arguments -s \
    '(-c -m -a)-U[don'\''t expand aliases]' \
    '(-M)-R[mark as read]' \
    '(-R)-M[mark as mapped]' \
    '(-c -z -m -a)-k[ksh-style autoloading]' \
    '(-c -k -m -a)-z[zsh-style autoloading]' \
    '(-U -z -k)-c[currently defined functions]' \
    '(-U -z -k)-m[use names as patterns]' \
    '(-U -z -k)-a[write autoload functions]' \
    ':zwc file:_files' \
    '*:function:->function' && return 0

if (( $+opt_args[-c] )); then
  _wanted functions expl 'function to write' compadd - ${(k)functions}
else
  _description files expl 'zsh source file'
  _files "$expl[@]"
fi