zsh-users
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-users@sunsite.dk
Subject: Re: Completion and surfraw
Date: Thu, 21 Apr 2005 19:40:06 -0400	[thread overview]
Message-ID: <20050421234006.GA24532@scowler.net> (raw)
In-Reply-To: <20050421222812.GG6044@berini.org>

> 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:]]##--*}'


  reply	other threads:[~2005-04-21 23:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-21 22:28 Philippe Berini
2005-04-21 23:40 ` Clint Adams [this message]
2005-04-22  0:10   ` Philippe Berini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050421234006.GA24532@scowler.net \
    --to=clint@zsh.org \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).