File: _zcompile

package info (click to toggle)
zsh 5.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,856 kB
  • sloc: ansic: 108,138; sh: 6,976; makefile: 722; perl: 687; awk: 291; sed: 16
file content (29 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#compdef zcompile

local state line expl curcontext="$curcontext" ret=1
typeset -A opt_args

_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 [[ $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 'file'
  _files "$expl[@]" && ret=0
fi

return ret