1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-10-03 17:31:33 +02:00
zsh/Completion/Builtins/_zmodload
2000-08-15 17:06:09 +00:00

22 lines
632 B
Plaintext

#compdef zmodload
local fl="$words[2]" expl ret=1
if [[ "$fl" = -*(a*u|u*a)* || "$fl" = -*a* && CURRENT -ge 4 ]]; then
_wanted builtins expl 'builtin command' compadd "$@" -k builtins
elif [[ "$fl" = -*u* ]]; then
_wanted modules expl module compadd -k modules
else
_tags files aliases
while _tags; do
_requested files expl 'module file' \
_files -W module_path -/g '*.(dll|s[ol])(:r)' && ret=0
if _requested aliases expl 'module alias'; then
local array
array=(${${(f)"$(zmodload -A)"}%% *})
(( $#array )) && compadd "${expl[@]}" -- $array && ret=0
fi
(( ret )) || break
done
fi