From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10556 invoked from network); 15 Aug 2000 15:53:27 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Aug 2000 15:53:27 -0000 Received: (qmail 29226 invoked by alias); 15 Aug 2000 15:53:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12650 Received: (qmail 29219 invoked from network); 15 Aug 2000 15:53:19 -0000 Date: Tue, 15 Aug 2000 16:52:36 +0100 From: Peter Stephenson Subject: Re: Seg fault with zmodload -u In-reply-to: "Your message of Tue, 15 Aug 2000 16:18:48 BST." <200008151518.QAA42116@cm01.ess> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FZC00AE8C3OVZ@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT 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 Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070