Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion and surfraw
- X-seq: zsh-users 8733
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Completion and surfraw
- Date: Thu, 21 Apr 2005 19:40:06 -0400
- In-reply-to: <20050421222812.GG6044@xxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20050421222812.GG6044@xxxxxxxxxx>
> 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:]]##--*}'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author