about summary refs log tree commit diff
path: root/Completion/Unix/Command/_surfraw
blob: b9b3e4bc33e8abba03a08764424933a6f07233c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
#compdef surfraw sr

local expl

_arguments -A \
  '-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
		(alioth)
		  _arguments \
			'-type=-:Search type:(soft skill people)' \
		  '*:Search String:->string'
		;;
		(altavista)
		  _arguments \
			'-results=-:[Number of results to return]:' \
		  '*:Search String:->string'
		;;
		(amazon)
		  _arguments \
			'-country=-:Two letter domain-style country code:(uk de fr jp us)' \
			'-search=-:Specialized search on topic:(all auctions books cars classical \
								dvd electronics garden kitchen music \
								outlet photo software toys tools \
							       	vhs videogames zshops wireless)' \
		  '*:Search String:->string'
		;;
		(ask)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(austlii)
		  _arguments \
			'-method=-:Search method:(any all phrase title boolean)' \
  			'-results=-:[Number of results to return]:' \
		  '*:Search String:->string'
		;;
		(bbcnews)
		  _arguments \
			'scope=-:Search scope:(world uk)' \
		  '*:Search String:->string'
		;;
		(cddb)
		  _arguments \
			'-artists[Search artists]' \
			'-albulms[Search albulms]' \
			'-songs[Search songs]' \
			'-all[Search all artists, albulms and songs]' \
		  '*:Search String:->string'
		;;
		(cia)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(cite)
		  _arguments \
			'-results=-:[Number of results to return]:' \
		  '*:Search String:->string'
		;;
		(cnn)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(currency)
	 	  _arguments \
			'-l[List all known currency symbols]' \
			'-from=-:Symbol for currency to convert from:(EUR USD GBP CAD AUD JPY INR NZD CHF ZAR)' \
			'-to=-:Symbol for currency to convert to:(EUR USD GBP CAD AUD JPY INR NZD CHF ZAR)' \
			'*:Currency Amount:->string'
		;;
		(cve)
		  _message 'CVE Number' \
		  '*:CVE Number:->string'
		;;
		(debbugs)
		  _arguments \
			'-search=:Search Type:(pkg src bug maint tag submitter)' \
			'-arc[Show archived bugs]' \
  			'-raw[Do not sort by status or severity]' \
	  		'-rb[Reverse order of bugs shown]' \
	  		'-rst[Reverse order of statuses shown]' \
 	 		'-rse[Reverse order of severities shown]' \
  			'-merge[Display merged bugs only once]' \
	  		'-nohead[Do not show table of contents header]' \
  			'-nofoot[Do not show statistics in the footer]' \
          		'-mbox[View results in mbox format]' \
			'-incstat=:Include statuses:_values -s , open forwarded pending fixed done' \
  			'-exstat=-:Exclude statuses:_values -s , open forwarded pending fixed done' \
	  		'-incsev=-:Include severities:_values -s , critical grave serious important \
								   normal minor wishlist fixed' \
 			'-exsev=-:Exclude severities:_values -s , critical grave serious important \
								  normal minor wishlist fixed' \
  			'-inctag=-:Include tags:_values -s , potato woody sarge sarge-ignore sid \
							     experimental confirmed d-i fixed \
                	                 		     fixed-in-experimental fixed-upstream \
							     help moreinfo patch pending security \ 
							     unreproducible upstream wontfix' \
	  		'-extag=-:Exclude tags:_values -s , potato woody sarge sarge-ignore sid \
							    experimental confirmed d-i fixed \
        	                         		    fixed-in-experimental fixed-upstream \
							    help moreinfo patch pending security \ 
							    unreproducible upstream wontfix' 
			_deb_packages avail
		;;
		(debcontents)
		  _arguments \
			'-arch=-:Seach specific architecture:(i386 m68k alpha sparc powerpc arm)' \
			'-distro=-:Search specific distribution:(stable testing unstable)'
			_deb_packages avail
		;;
		(deblists)
		  _arguments \
			'-shelp[Go to search help page]' \
			'-results=-[Number of results to return]' \
			'-dates=-[Quarters to search]' \
			'-case=-:Case sensitivity:(no yes)' \
			'-errors=-:Allowed errors:(0 1 2 best)' \
			'-partial:Partial matches:(no yes)' \
			'-sameline:Semicolon separated words must appear on same line:(no yes)' \
			'-lines=-:Maximum lines per message:(0 5 10 50 100)' \
			'-list=-:Search list:(68k accessibility admintool alpha amd64 announce apache arm \
						autobuild beowulf books boot bsd cd cd-vendors cdwrite \
 						changes chinese chinese-big5 chinese-gb commercial \
						consultants ctte curiosa custom dak debbugs deity \
						desktop devel devel-announce devel-changes devel-french \
						devel-games devel-italian devel-m68k-changes devel-portuguese \
     						devel-powerpc-changes devel-s390-changes devel-spanish \
						devel-sparc-changes doc dpkg edu emacsen embedded esperanto \
						events-eu events-na faq firewall french gcc glibc \
						gtk-gnome hams handheld hppa hurd i18n ia64 ipv6 isp \
						italian japanese java jr kde kernel l10n-arabic \
						l10n-catalan l10n-czech l10n-danish l10n-dutch \
        					l10n-english l10n-finnish l10n-french l10n-german l10n-greek \
        					l10n-hungarian l10n-italian l10n-korean l10n-polish \
						l10n-portuguese l10n-romanian l10n-russian l10n-spanish \
						l10n-turkish laespiral laptop lcs-eng legal lex \
						lint-maint lsb lsb-confcall lsb-discuss lsb-impl \
        					lsb-spec lsb-test med mentors mips mirrors multimedia newmaint \
        					newmaint-admin newmaint-discuss news news-french news-german \
        					news-portuguese nonprofit ocaml-maint openoffice parisc \
						perl pilot policy pool powerpc project publicity python \
						qa qa-packages qa-private qt-kde release ruby russian \
						s390 s390-changes security security-announce sgml \
						simplified-chinese snapshots sparc sparc-changes \
						spi-announce spi-general ssh superh testing tetex-maint \
     						toolchain ultralinux user user-catalan user-danish \
						user-de user-french user-german user-icelandic \
						user-indonesian user-polish user-portuguese user-spanish \
						user-swedish user-turkish user-ukrainian vgui-discuss \
        					vote win32 wnpp women www x)'
		  '*:Search String:->string'
		;;
		(deblogs)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(debpackages)
		  _arguments \
			'-release=-:Search release:(all main non-US contrib non-free)' \
  			'-distro=-:Search distribution:(all stable testing unstable)' 
		  _deb_packages avail
		;;
		(debpts)
		  _arguments \
			'-doc[Display documentation]'
		;;
		(deja)
		  _arguments \
			'-results=-:[Number of results to return]:' \
			'-m[Search for Message-ID]' \
		  '*:Search String:->string'
		;;
		(dmoz)
		  _arguments \
			'-cat=-:Search category:(All Arts Business Computers Games Health Home \
						Kids_and_Teens News Recreation Reference Regional \
						Science Shopping Society Sports World Adult)' \
		  	'-type=-:Search type:(c s b)' \
  			'-kids[Sites for kids]' \
  			'-teens[Sites for teens]' \
  			'-mteens[Sites for mature teens]' \
		  '*:Search String:->string'
		;;
		(ebay)
		  _arguments \
			'-country=-:Country:(com de uk fr)' \	
			'-results=-:[Number of results to return]:' \ 
		  '*:Search String:->string'
		;;
		(etym)
		  _wanted dictword expl 'dictionary word' \
		    	compadd $(look "${PREFIX}")
		;;
		(excite)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(fast)
		  _arguments \
			'-type=-:Search type:(all any phrase)' \
		  '*:Search String:->string'
		;;
		(filesearching)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(foldoc)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(freebsd)
		  _arguments \
		  	'-mail=-:Search mailinglists:(yes no)' \
			'-gg=-:Search mailinglists at Google Groups:(yes no)' \
			'-pr=-:Query problem reports:(yes no)' \
  			'-cvs=-:Query cvsweb:(yes no)' \
 			'-mid=-:Query mailing lists by Message-ID:(yes no)' \
			'-ps=-:Teleport to the Port Survey Page:(yes no)' \
  			'-prs=-:Teleport to the Problem Report Survey Page:(yes no)' \
  			'-elogs=-:Teleport to the Build Error Logs Page:(yes no)' \
		  '*:Search String:->string'
		;;
		(freedb)
		  _arguments \
			'-artists[Search artists]' \
			'-albulms[Search albulms]' \
			'-songs[Search songs]' \
			'-rest[Search the rest of the data]' \
			'-all[Search all fields]' \
			'-bycat[Sort results by category]' \
			'*-cat=-:Category to search:(all blues classical country data folk \
							jazz misc newage reggae rock soundtrack)' \
		  '*:Search String:->string'
		;;
		(freshmeat)
		  _deb_packages avail
		;;
		(google)
		  _arguments \
			'(-l --lucky)'{-l,--lucky}'[Feeling lucky?]' \
			'-results=-:[Number of results to return]:' \
			'-search=-:Search on topic:(bsd linux mac unclesam)' \
		  '*:Search String:->string'
		;;			 
		(happypenguin)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(imdb)
		  _arguments \
  			'-category=-:Category:(All Titles MyMovies People Characters Quotes Bios Plots)' \
		  '*:Search String:->string'
		;;
		(jake)
		  _arguments \
			'-method=-:Search type:(title issn)' \
 			'-volume=-:[Volume]:' \
 			'-issue=-:[Issue]:' \
			'-spage=-:[Start page]:' \
 			'-epage=-:[End page]:' \
 			'-year=-:[Year]:' \
		  '*:Search String:->string'
		;;
		(leodict)
		  _arguments \
			'-tol=:Special character tolerance:(off standard high)' \
                  	'-to=:To language:(de en either)' \
  			'-lang=:Webpage is in this language:(en de)' \
  			'-link=:Link results:(on off)' \
  			'-head=:Display headlines:(on off)' \
  			'-grid=:Show results in grid:(on off)' \
  			'-spell=:Spelling tolerance:(off standard force)' \
			'*:dictionary word:->dictword' && return 0

		  case "$state" in
			(dictword)
		  		_wanted dictword expl 'dictionary word' \
		  			compadd $(look "${PREFIX}")
			;;
		  esac
		;;
		(netbsd)
		  _arguments \
			'-mail=-:Search netbsd mailinglists:(no yes)' \
			'-pr=-:Query problem reports:(no yes)' \
		  '*:Search String:->string'
		;;
		(openbsd)
		  _arguments \
			'-mail=-:Search netbsd mailinglists:(no yes)' \
			'-pr=-:Query problem reports:(no yes)' \
		  '*:Search String:->string'
		;;
		(pgpkeys)
		  _arguments \
			'-s[Display key signatures]' \
		  '*:KeyID or Email:->string'
		;;
		(pubmed)
		  _arguments \
			'-db=-:Search Database:(PubMed Nucleotide Protein Genome Structure Popset)' \
		  '*:Search String:->string'
		;;
		(rfc)
		  _arguments \
                        '-results=-:[Number of results to return]:' \
  			'-pdf[Return files as PDFs]' \
  			'-rev[Reverse order of results]' \
  			'-exact[Match exact words (instead of prefixes)]' \
  			'-abs[Show abstracts]' \
  			'-keywords[Show keywords]' \
  			'-nodirect[Do not try and go direct to RFC]' \
  			'-ftp[Retrieve RFCs via FTP instead of HTTP]' \
  			'-field=-:Search fields:(all number title author keyword)' \
  			'-search=-:Collection to search(all rfc std bcp fyi)' \
		  '*:Search String:->string'
		;;
		(scaleplus)
		  _arguments \
                        '-results=-:[Number of results to return]:' \
		  '*:Search String:->string'
		;;
		(slashdot)
	 	  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(slinuxdoc)
		  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(sourceforge)
		  _arguments \
			'-exact=-:Require all words:(yes no)' \
			'-type=:Type of search:(soft people freshmeat)'
		  _deb_packages avail
		;;
		(stockquote)
		  _arguments \
			'-provider=-:Quote provider(yahoo nasdaq quote)' \
		  '*:Search String:->string'
		;;
		(sundocs)
	 	  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(sunsolve)
	 	  _message 'Search String' \
		  '*:Search String:->string'
		;;
		(thesaurus)
		  _wanted dictword expl 'thesaurus word' \
		    	compadd $(look "${PREFIX}")
		;;
		(webster)
		  _wanted dictword expl 'dictionary word' \
		    	compadd $(look "${PREFIX}")
		;;
		(rae)
		  _wanted dictionary expl 'palabra diccionario' \
		    	compadd $(look "${PREFIX}")
		;;
		(translate)
		  _arguments \
                  	'-from=-:From language:(de en es fr it ja ko pt ru zh)' \
                  	'-to=-:To language:(de en es fr it ja ko pt ru zh)' \
                  	'-provider=-:Translation service provider:(raging bablefish)' \
                  	'*:dictionary word:->dictword' && return 0

		  case "$state" in
			(dictword)
				_wanted dictword expl 'dictionary word' \
			    		compadd $(look "${PREFIX}")
		  	;;
		  esac	
		;;
		(rhyme)
		  _arguments \
			'-method=-:Type of word correlation:(perfect syn hom cons rel sub spell pic shake def)' \
		  '*:dictionary word:->dictword' && return 0

		  case "$state" in
			(dictword)
				_wanted dictword expl 'dictionary word' \
					compadd $(look "${PREFIX}")
			;;
		  esac
		;;
		(w3css)
		  _arguments \
			'-warnings=-:Level of warnings displayed:(all normal important none)' \
			'-profile=-:CSS profile:(none css1 css2 css3 svg svgbasic svgtiny mobile atsv-tv tv)' \
			'-medium=-:User medium:(all aural braille embossed handheld print projection \
						screen tty tv presentation)' \
		  :URL:_urls
		;;
		(w3html)
		  _arguments \
			'-usage[Go to validator help page]' \
			'-encoding=-[Set page encoding]' \
			'-encfb[Fall back to encoding rather than override]' \
			'-doctype=-":[Set page doctype]:' \
			'-docfb[Fall back to doctype rather than override]' \
			'-nv[Be less verbose]' \
			'-showsource[Show page source]' \
 			'-showoutline[Show page outline (headings)]' \
			'-showparsetree[Show parse tree]' \
	 		'-excludeatt[Exclude attributes from parse tree]' \
  			'-err[Validate Error (404) pages]' \
		  :URL:_urls
		;;
		(w3link)
		  _arguments \
			'-r[Check linked documents recursively]' \
	 	 	'-d=-:[Recursion depth]:' \
		  	'-s[Summary only]' \
			'-hiderd[Hide redirects]' \
  			'-dhiderd[Hide redirects for directories only]' \
  			'-nolang[Dont send the Accept-Language: header]' \
  			'-cookie[Save options in a cookie]' \
		  :URL:_urls
		;;
		(w3rdf)
		  _arguments \
  			'-output=-:Type of output displayed:(Triples Graphs Both)' \
  			'-format=-:Graph format:(PNG_EMBED PNG_LINK SVG_LINK SVG_EMBED GIF_EMBED \
						GIF_LINK PS_LINK HP_PCL_LINK HP_GL_LINK ISV_ZVTM)' \
			'-savedot[Save GraphViz DOT file]' \
  			'-ntriples[Display triples in N-Triples format]' \
  			'-embedded[RDF is NOT enclosed in <RDF> tags]' \
  			'-useme[I grant w3c permission to save the RDF for developing test cases]' \
  			'-anon[Make anonymous nodes unlabelled]' \
  			'-fontsize=-:Font Size:(10 12 14 16 20)' \
  			'-orient=-:Orientation:(TB LR)' \
  			'-node=-:Node Colour:(Black Blue Darkgreen Red)' \
  			'-nodetext=-:Node Text Colour:(Black Blue Darkgreen Red)' \
  			'-arc=-:Arc Colour:(Black Blue Darkgreen Red)' \
  			'-arctext=-:Arc Text Colour:(Black Blue Darkgreen Red)' \
		  :URL:_urls
		;;
		(wetandwild)
		  _arguments \
			'-city=-:[Town or City or (US only) zipcode]:' \
			'-country=-:[Two letter domain-style country code]:' \
			'-provider=-yahoo[Weather provision service (Yahoo only right now)]' \
			'-state=-:[State, province or region]:'
		;;
		(wikipedia)
		  _arguments \
			'-language=-:[Two letter language code]:' \
		  '*:Search String:->string'
		;;
		(woffle)
		  _arguments \
			'-method=-:Search method:(and or bool)' \
  			'-format=-:Result format:(short long)' \
  			'-sort=-:Sort method:(score revscore time revtime title revtitle)' \
		  '*:Search String:->string'
		;;
		(xxx)
  		  _message 'Search String' \
		  '*:Search String:->string'		
		;;
		(yahoo)
		  _arguments \
			'-results=-:[Number of results to return]:' \
		  '*:Search String:->string'
		;;
		(yubnub)
  		  _message 'Yubnub Command' \
		  '*:Yubnub Command:->string'
		;;
	esac
	;;
esac