From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28434 invoked from network); 24 Jul 2006 05:44:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,RCVD_IN_SORBS_WEB autolearn=no version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Jul 2006 05:44:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 1708 invoked from network); 24 Jul 2006 05:43:55 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Jul 2006 05:43:55 -0000 Received: (qmail 4151 invoked by alias); 24 Jul 2006 05:43:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10541 Received: (qmail 4140 invoked from network); 24 Jul 2006 05:43:48 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Jul 2006 05:43:48 -0000 Received: (qmail 696 invoked from network); 24 Jul 2006 05:43:48 -0000 Received: from ultrasuede.reed.edu (134.10.2.46) by a.mx.sunsite.dk with SMTP; 24 Jul 2006 05:43:46 -0000 Received: from [66.81.17.108] (66-81-17-108.socal.dialup.o1.com [66.81.17.108]) (authenticated bits=0) by ultrasuede.reed.edu (8.13.7/8.13.6) with ESMTP id k6O5haV0001920 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sun, 23 Jul 2006 22:43:40 -0700 Mime-Version: 1.0 (Apple Message framework v623) Content-Transfer-Encoding: 7bit Message-Id: <1384623ea383e482ce2731af9dde8343@netwood.net> Content-Type: text/plain; charset=US-ASCII; format=flowed To: zsh-users@sunsite.dk From: Jesse W Subject: Dynamic completion question Date: Sun, 23 Jul 2006 22:10:22 -0700 X-Mailer: Apple Mail (2.623) X-Scanned-By: MIMEDefang 2.53 on 134.10.2.46 I'm working on adding the ability to handle FLAC tags dynamically with the completion I wrote; I've got something that *mostly* works. function _metaflac_tags () { local foo bar foo=$(metaflac $line[1] --export-tags-to=-) #Gets a list of the tags (and their values) bar=("${(@)${(f)foo}%[=]*}") #Cuts the list into an array just of the tag names (what I want) compadd -a bar -X "Existing tags" } This is called from: _arguments '--show-tag=:FLAC tags:_metaflac_tags' My questions are, first, is this the right way to do this? Should I use some utility function instead? (maybe _alternatives or something?) Second, assuming this *is* the right way to do this, how do I get a neat looking description line, like I get for all the other argument completions? I assume I'm pre-empting it with my call to compadd, somehow, but I don't understand how this is happening. Suggestions greatly appreciated! Jesse Weinstein