#compdef zmodload

local fl="$words[2]" expl

if [[ "$fl" = -*(a*u|u*a)* || "$fl" = -*a* && CURRENT -ge 4 ]]; then
  _wanted builtins expl 'builtin command' &&
      compadd "$expl[@]" "$@" - "${(k@)builtins}"
elif [[ "$fl" = -*u* ]]; then
  _wanted modules expl module && compadd "$expl[@]" - "${(@k)modules}"
else
  _wanted files expl 'module file' &&
      compadd "$expl[@]" - ${^module_path}/*.s[ol](N:t:r)
fi
