#compdef surfraw sr local expl _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]' \ '-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:]]##--*}' \ '*:arg:->subcmd' && return 0 case "$state" in (subcmd) case "$line[1]" in # Allows for "sr debbugs 4" to check for 44bsd-rdist bugs... (alioth|deb(bug|contents|package|pt)s|freshmeat|sourceforge) _deb_packages avail ;; # Allows for "sr l vy" to find the German word for "vying" using leodict (leodict) _wanted dictword expl 'dictionary word' \ compadd $(look "${PREFIX}") ;; (thesaurus) _wanted dictword expl 'thesaurus word' \ compadd $(look "${PREFIX}") ;; (webster) _wanted dictword expl 'dictionary word' \ compadd $(look "${PREFIX}") ;; (etym) _wanted dictword expl 'dictionary word' \ compadd $(look "${PREFIX}") ;; (rae) _wanted dictionary expl 'palabra diccionario' \ compadd $(look "${PREFIX}") ;; (translate) _arguments \ '-from=:Source language:(de en es fr it ja ko pt ru zh)' \ '-to=:Destination language:(de en es fr it ja ko pt ru zh)' \ '-provider=:Translation service provider:(raging bablefish)' \ _wanted dictionary expl 'dictionary word' \ compadd $(look "${PREFIX}") ;; (*) compadd duh ;; esac ;; esac