summary refs log tree commit diff
path: root/Completion/Builtins/_zmodload
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-08-08 09:13:36 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-08-08 09:13:36 +0000
commitc66544a86b60c435741e019ca03da2bc3b7d7108 (patch)
treecce931dc33a4d35b74add75156f01ca458582e82 /Completion/Builtins/_zmodload
parent72f4ec6b76ae0a5fdb10483a1c51cc60e0c93782 (diff)
downloadzsh-c66544a86b60c435741e019ca03da2bc3b7d7108.tar.gz
zsh-c66544a86b60c435741e019ca03da2bc3b7d7108.tar.xz
zsh-c66544a86b60c435741e019ca03da2bc3b7d7108.zip
12561: Completion/Builtins/_zmodload, Doc/Zsh/builtins.yo,
Src/builtin.c, Src/module.c, Src/zsh.h: aliases for modules
done internally via `zmodload -[AR]'
Diffstat (limited to 'Completion/Builtins/_zmodload')
-rw-r--r--Completion/Builtins/_zmodload11
1 files changed, 9 insertions, 2 deletions
diff --git a/Completion/Builtins/_zmodload b/Completion/Builtins/_zmodload
index 5ca167152..4fa2183a6 100644
--- a/Completion/Builtins/_zmodload
+++ b/Completion/Builtins/_zmodload
@@ -1,11 +1,18 @@
 #compdef zmodload
 
-local fl="$words[2]" expl
+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
-  _wanted files expl 'module file' _files -W module_path -/g '*.s[ol](:r)'
+  _tags files aliases
+  while _tags; do
+    _requested files expl 'module file' \
+      _files -W module_path -/g '*.s[ol](:r)' && ret=0
+    _requested aliases expl 'module alias' \
+      compadd -- ${${(f)"$(zmodload -A)"}%% *} && ret=0
+    (( ret )) || break
+  done
 fi