Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Seg fault with zmodload -u
- X-seq: zsh-workers 12650
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Re: Seg fault with zmodload -u
- Date: Tue, 15 Aug 2000 16:52:36 +0100
- In-reply-to: "Your message of Tue, 15 Aug 2000 16:18:48 BST." <200008151518.QAA42116@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Oliver wrote:
> On the subject of zmodload completion, how would I prevent the 'module
> alias' description from being displayed when there are no module
> aliases - do I have to put the zmodload -A output in an array first and
> then not call the _requested line if the array is empty - or is there a
> better way?
This is easy, anyway. (Remind me to commit this later.)
Index: Completion/Builtins/_zmodload
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_zmodload,v
retrieving revision 1.4
diff -u -r1.4 _zmodload
--- Completion/Builtins/_zmodload 2000/08/14 15:46:17 1.4
+++ Completion/Builtins/_zmodload 2000/08/15 15:52:12
@@ -11,8 +11,11 @@
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
--
Peter Stephenson <pws@xxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author