From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16923 invoked from network); 21 Apr 2005 23:40:26 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 21 Apr 2005 23:40:26 -0000 Received: (qmail 63039 invoked from network); 21 Apr 2005 23:40:20 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Apr 2005 23:40:20 -0000 Received: (qmail 14124 invoked by alias); 21 Apr 2005 23:40:12 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8733 Received: (qmail 14113 invoked from network); 21 Apr 2005 23:40:12 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 21 Apr 2005 23:40:12 -0000 Received: (qmail 61987 invoked from network); 21 Apr 2005 23:40:12 -0000 Received: from acolyte.scowler.net (216.254.112.45) by a.mx.sunsite.dk with SMTP; 21 Apr 2005 23:40:08 -0000 Received: by acolyte.scowler.net (Postfix, from userid 1000) id 35B2D70046; Thu, 21 Apr 2005 19:40:06 -0400 (EDT) Date: Thu, 21 Apr 2005 19:40:06 -0400 From: Clint Adams To: zsh-users@sunsite.dk Subject: Re: Completion and surfraw Message-ID: <20050421234006.GA24532@scowler.net> Mail-Followup-To: zsh-users@sunsite.dk References: <20050421222812.GG6044@berini.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050421222812.GG6044@berini.org> User-Agent: Mutt/1.5.6+20040907i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 > Up to now, the only problem is with surfraw: with bash, I used to type: > > % sr [TAB] > > and I was proposed the elvi list (alioth, altavista, amazon etc.) to > complete. > With zsh however, I get the files of the directory I'm in. Someone has written a completion function for bash, but not for zsh. Here's a start. Someone who actually uses surfraw should flesh it out more. Index: Completion/Unix/Command/_surfraw =================================================================== RCS file: Completion/Unix/Command/_surfraw diff -N Completion/Unix/Command/_surfraw --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Completion/Unix/Command/_surfraw 21 Apr 2005 23:35:45 -0000 @@ -0,0 +1,15 @@ +#compdef surfraw sr + +_arguments \ + '-browser=[set browser]:browser:_command_names' \ + '-elvi[list Surfraw mechanisms for conquering evil]' \ + '-escape-url-args=[apply url escaping to arguments]:bool:(yes no)' \ + '(-g -graphical)'{-g,-graphical}'[get some windowed sin]' \ + '-p0rn=[Yes, yes, harder, deeper, faster, oh baybe]:bool:(yes no)' \ + '-help' \ + '-quiet:bool:(yes no)' \ + '-new[start in a new window]' \ + '(-t -text)'{-t,-text}'[back to the yellow brick road]' \ + '(-q -quote)'{-q,-quote}'[Quote arguments with quote characters]' \ + '-version[display Surfraw version]' \ + ':elvi: compadd ${${(f)"$(surfraw -elvi)"}%%[[:space:]]##--*}'