From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11298 invoked from network); 28 Mar 2006 16:35:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.1 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Mar 2006 16:35:52 -0000 Received: (qmail 23345 invoked from network); 28 Mar 2006 16:35:40 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Mar 2006 16:35:40 -0000 Received: (qmail 5406 invoked by alias); 28 Mar 2006 16:35:33 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10097 Received: (qmail 5395 invoked from network); 28 Mar 2006 16:35:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 Mar 2006 16:35:33 -0000 Received: (qmail 22288 invoked from network); 28 Mar 2006 16:35:33 -0000 Received: from lila.akte.de (213.239.211.75) by a.mx.sunsite.dk with SMTP; 28 Mar 2006 16:35:32 -0000 Received: (root@lila.akte.de) by lila.akte.de id ; Tue, 28 Mar 2006 18:35:23 +0200 KRecCount: 1 KInfo: virscan ok KInfo: !spam auth Received: from condor.int.spiegl.de (p54976858.dip.t-dialin.net [84.151.104.88]) by lila.akte.de via kasmail (2.9) id <1FOIA2-7b8-0-lila>; Tue, 28 Mar 2006 16:35:14 GMT Received: from condor.int.spiegl.de (spiegl@localhost [127.0.0.1]) by condor.int.spiegl.de (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k2SGZD6m007468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 28 Mar 2006 18:35:13 +0200 Received: (from spiegl@localhost) by condor.int.spiegl.de (8.13.4/8.13.4/Submit) id k2SGZDVP007463 for zsh-users@sunsite.dk; Tue, 28 Mar 2006 18:35:13 +0200 X-Authentication-Warning: condor.int.spiegl.de: spiegl set sender to zsh.Andy@spiegl.de using -f Date: Tue, 28 Mar 2006 18:35:13 +0200 From: Andy Spiegl To: zsh-users@sunsite.dk Subject: Re: completion with descriptions Message-ID: <20060328163513.GA7131@spiegl.de> Mail-Followup-To: zsh-users@sunsite.dk References: <20060327132750.GB27668@spiegl.de> <20060327163058.GA20833@spiegl.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060327163058.GA20833@spiegl.de> X-PGP-GPG-Keys: mail -s "send pgp" auto@spiegl.de X-Fingerprint: Key-ID C2CB30F0: 9051 50B9 13B0 57B9 10FD 48AC 4FA1 209B C2CB 30F0 X-Accepted-File-Formats: ASCII OpenOffice .rtf .pdf - *NO* Microsoft files please. X-why-you-shouldnt-use-MS-LookOut: http://www.jensbenecke.de/l-oe-en.php X-warum-man-MS-Outlook-vermeiden-sollte: http://www.jensbenecke.de/l-oe-de.php X-how-to-quote: http://learn.to/quote/ X-how-to-ask-questions: http://www.catb.org/~esr/faqs/smart-questions.html X-stupid-disclaimers: http://goldmark.org/jeff/stupid-disclaimers/ User-Agent: Mutt/1.5.9i > I took _aptitude as a template and came up with the following (see below) > which works as wanted except for the fact that zsh inserts the _whole_ > line (command + description) instead of just the command. *sigh* I solved it! For the records, the problem was an extra space: > cmds=( ${${(M)${(f)"$(gigaset --commands 2>/dev/null)"}:#* -- *}/(#b) (*[^ ]) #-- (*)/$match[1]:$match[2]:l}) right here ^^^ because my program doesn't begin the lines (in the list of possible commands) with a space. After also deleting the ":l" at the end zsh stopped converting all my German words to lowercase, oh what wonder. :-) So this works now beautifully: cmds=( ${${(M)${(f)"$(gigaset --commands 2>/dev/null)"}:#* -- *}/(#b)(*[^ ]) #-- (*)/$match[1]:$match[2]}) Thanks for all the help, Andy. -- "security is an exercise in applied paranoia" -- Unknown