zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: Seg fault with zmodload -u
Date: Tue, 15 Aug 2000 16:52:36 +0100	[thread overview]
Message-ID: <0FZC00AE8C3OVZ@la-la.cambridgesiliconradio.com> (raw)
In-Reply-To: "Your message of Tue, 15 Aug 2000 16:18:48 BST." <200008151518.QAA42116@cm01.ess>

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@csr.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


      parent reply	other threads:[~2000-08-15 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-15 15:18 Oliver Kiddle
2000-08-15 15:40 ` Thomas Köhler
2000-08-15 15:48   ` Thomas Köhler
2000-08-15 15:56     ` Thomas Köhler
2000-08-15 16:46       ` PATCH: " Bart Schaefer
2000-08-15 15:43 ` Andrej Borsenkow
2000-08-15 15:49   ` Andrej Borsenkow
2000-08-15 15:52 ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0FZC00AE8C3OVZ@la-la.cambridgesiliconradio.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).