From 7ffa89ea7da5f0391fbedde6a335ddfb36727cf2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 15 Aug 2000 17:06:09 +0000 Subject: 12650: don't show aliased modules if there aren't any --- Completion/Builtins/_zmodload | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Completion') 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 -- cgit 1.4.1