diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2000-08-15 17:06:09 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2000-08-15 17:06:09 +0000 |
commit | 7ffa89ea7da5f0391fbedde6a335ddfb36727cf2 (patch) | |
tree | 20a33bb6ffd02ee5c9b029a15e7d719ed648ee1e | |
parent | 934dd1c694f8b9f8569e375327aeddd8c321f284 (diff) | |
download | zsh-7ffa89ea7da5f0391fbedde6a335ddfb36727cf2.tar.gz zsh-7ffa89ea7da5f0391fbedde6a335ddfb36727cf2.tar.xz zsh-7ffa89ea7da5f0391fbedde6a335ddfb36727cf2.zip |
12650: don't show aliased modules if there aren't any
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Builtins/_zmodload | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 262d6b387..0f9dfa428 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-08-15 Peter Stephenson <pws@csr.com> + + * 12650: Completion/Builtins/_zmodload: don't lists aliases if + there aren't any. + 2000-08-15 Bart Schaefer <schaefer@zsh.org> * 12652: Src/module.c: Fix variable scoping problem that caused diff --git a/Completion/Builtins/_zmodload b/Completion/Builtins/_zmodload index d182cbff7..fd476ca99 100644 --- a/Completion/Builtins/_zmodload +++ b/Completion/Builtins/_zmodload @@ -11,8 +11,11 @@ else while _tags; do _requested files expl 'module file' \ _files -W module_path -/g '*.(dll|s[ol])(:r)' && ret=0 - _requested aliases expl 'module alias' \ - compadd -- ${${(f)"$(zmodload -A)"}%% *} && 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 |