From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1257 invoked from network); 22 Nov 2006 08:36:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,RCVD_IN_BL_SPAMCOP_NET autolearn=no version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Nov 2006 08:36:06 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 50793 invoked from network); 22 Nov 2006 08:35:54 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Nov 2006 08:35:54 -0000 Received: (qmail 25592 invoked by alias); 22 Nov 2006 08:35:45 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11014 Received: (qmail 25577 invoked from network); 22 Nov 2006 08:35:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Nov 2006 08:35:43 -0000 Received: (qmail 49635 invoked from network); 22 Nov 2006 08:35:43 -0000 Received: from wx-out-0506.google.com (66.249.82.224) by a.mx.sunsite.dk with SMTP; 22 Nov 2006 08:35:38 -0000 Received: by wx-out-0506.google.com with SMTP id i31so134222wxd for ; Wed, 22 Nov 2006 00:35:37 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=KFk69/9NGZa35XHKFwhVz0TXGO278w+LCGlJysbx7FZTA/sIU4F4bQYl1gKJzOtDhqMWE3q4ZZUO4tL3sp+pr4VPILQ2oyCZfCySikbLHYC+ZMrAdiGM7ygknx1A/6lPDSj+ln534PFYkD0UXtayRQ4N0qoKB+5OnyVN02lxCO0= Received: by 10.90.72.10 with SMTP id u10mr6404432aga.1164184537303; Wed, 22 Nov 2006 00:35:37 -0800 (PST) Received: by 10.90.65.18 with HTTP; Wed, 22 Nov 2006 00:35:37 -0800 (PST) Message-ID: Date: Wed, 22 Nov 2006 09:35:37 +0100 From: "Nikolai Weibull" Sender: nikolai.weibull@gmail.com To: "Peter Stephenson" Subject: Re: Problem with _arguments Cc: "zsh-users@sunsite.dk" In-Reply-To: <200611212342.kALNg9m7006648@pwslaptop.csr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200611212342.kALNg9m7006648@pwslaptop.csr.com> X-Google-Sender-Auth: 4b37ae0c0ddf4767 On 11/22/06, Peter Stephenson wrote: > "Nikolai Weibull" wrote: > > Say that I have > > > > #compdef craptastic > > > > _arguments \ > > '-s[omething]:with an argument' \ > > '*:directory:_directories' > > > > Then, at least with my setup, if I have the following command line and > > press I get: > > > > % craptastic -s > > ::: with an argument ::: > > > > but if I have the following and press I get: > > > > % craptastic src -s > > ::: with an argument ::: > > ::: directory ::: > > > > Why is directory all of a sudden a viable option here? > > _arguments [ -nswWACRS ] [ -O name ] [ -M matchspec ] [ : ] spec ... > This function can be used to give a complete specification for > completion for a command whose arguments follow standard UNIX > option and argument conventions. > > "Standard UNIX option and argument conventions" are that all options > come before all non-option arguments. The GNU extension that they can > occur in any order is not supported. So -s is an argument following the > argument src. _arguments thinks src, -s and the argument you're now > completing are normal arguments and hence completes directories. But it still offers the completion for -s, so it must have /some/ sort of understanding of what's going on already. Oh well, I guess I'll have to give up on this for the time being. Actually, would there be a good way of tricking _arguments into only seeing what you want it to see? In this case, it would work fine if one could trick it into only seeing the stuff after src, so that it would continue completing options. Thanks. nikolai