From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13595 invoked from network); 26 Mar 2006 20:24:12 -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=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; 26 Mar 2006 20:24:12 -0000 Received: (qmail 43155 invoked from network); 26 Mar 2006 20:24:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Mar 2006 20:24:03 -0000 Received: (qmail 6534 invoked by alias); 26 Mar 2006 20:23:56 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10090 Received: (qmail 6524 invoked from network); 26 Mar 2006 20:23:55 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 26 Mar 2006 20:23:55 -0000 Received: (qmail 42179 invoked from network); 26 Mar 2006 20:23:55 -0000 Received: from mta08-winn.ispmail.ntl.com (HELO mtaout02-winn.ispmail.ntl.com) (81.103.221.48) by a.mx.sunsite.dk with SMTP; 26 Mar 2006 20:23:54 -0000 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20060326202353.QRHN29040.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Sun, 26 Mar 2006 21:23:53 +0100 Received: from pwslaptop.csr.com ([82.6.97.150]) by aamtaout01-winn.ispmail.ntl.com with ESMTP id <20060326202353.THUW9667.aamtaout01-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Sun, 26 Mar 2006 21:23:53 +0100 Received: from pwslaptop.csr.com (pwslaptop.csr.com [127.0.0.1]) by pwslaptop.csr.com (8.13.4/8.13.4) with ESMTP id k2QKNlNo006389 for ; Sun, 26 Mar 2006 21:23:47 +0100 Received: from pwslaptop.csr.com (pws@localhost) by pwslaptop.csr.com (8.13.4/8.13.4/Submit) with ESMTP id k2QKNlaG006386 for ; Sun, 26 Mar 2006 21:23:47 +0100 Message-Id: <200603262023.k2QKNlaG006386@pwslaptop.csr.com> X-Authentication-Warning: pwslaptop.csr.com: pws owned process doing -bs From: Peter Stephenson To: zsh-users@sunsite.dk Subject: Re: which completion function are used for aliases? In-Reply-To: Message from Andy Spiegl of "Sun, 26 Mar 2006 21:20:54 +0200." <20060326192054.GA27247@spiegl.de> Date: Sun, 26 Mar 2006 21:23:47 +0100 Andy Spiegl wrote: > Now, is it also possible to make zsh "know" the options of the alias, > so that I don't have to hardcode the aliases in my completion function? > > But how can I get the details of the defined aliases??? > > # Default directories (depending on which alias is used) > if [[ -z $dir ]]; then > if [[ $words[1] = gigaset2 ]]; then > dir="/home/spiegl/movies/gigaset/PVR/" > elif [[ $words[1] = gigaset3 ]]; then > dir="/data2/movies/gigaset/PVR/" > elif [[ $words[1] = gigaset-ext ]]; then > dir="/extern-dos/Video/" > else > dir="/data/movies/gigaset/PVR/" > fi > fi > > PS: > gigaset2='gigaset --dir /home/spiegl/movies/gigaset/PVR' > gigaset3='gigaset --dir /data2/movies/gigaset/PVR' > gigaset-ext='gigaset --dir /extern-dos/Video' if [[ $aliases[$words[1]] = *" --dir "* ]]; then dir=${aliases[$words[1]]##*--dir } fi -- Peter Stephenson Web page still at http://www.pwstephenson.fsnet.co.uk/