Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: some completion functions :)



On Wed, Jul 23 2003, baptiste daroussin wrote something resembling:
> Hi,
> I've written some completion function for :
> rar, unrar (_rar)
> oggenc, ogginfo, oggdec, ogg123 (_vorbis)
> I've updated _links to work with links >= 2.X
> I've improved _pkgtool
> Sory, no path because I've overwritten the different scripts :(
>
> I've tested it under gentoo 1.4 with zsh 4.0.6 and slackware 9.1 with
> zsh 4.0.7 and zsh 4.1.1
>
> Normaly all works :)
>
nice...here's my ogg123 completion function.  i think it is a bit more
complete than yours.  you may want to include some of them perhaps?

enjoy,
	nikolai

--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star       :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,php,war3  :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
#compdef ogg123
  
# this still needs fixing with the --device-option code 

local expl
      
_arguments \
	'--audio-buffer[size of output buffer]:kilobytes:' \
	{'(-@)--list','(--list)-@'}'[playlist to play from]:playlist:_files' \
	{'(-b)--buffer','(--buffer)-b'}'[size of input buffer]:kilobytes:' \
	{'(-p)--prebuffer','(--prebuffer)-p'}'[prebuffer percentage]:percent:' \
	{'(-d)--device','(--device)-d'}'[output device]:device:((null\:"discards all data" oss\:"Open Sound System" sun\:"Sun Audio" alsa\:"Advanced Linux Sound Architecture" irix\:"IRIX audio" arts\:"aRts Sound Daemon" esd\:"Enlightened Sound Daemon" au\:"Sun audio file" raw\:"Raw sample" wav\:"WAV file"))' \
	{'(-f)--file','(--file)-f'}'[output file for file devices]:file:_files' \
	{'(-h)--help','(--help)-h'}'[show help]' \
	{'(-k)--skip','(--skip)-k'}'[skip into file]:seconds:' \
	{'*--device-option','*-o'}'[assign device option values]:devopts:->devopts' \
	{'(--verbose -v -q)--quiet','(--verbose -v --quiet)-q'}'[quiet mode]' \
	{'(-V)--version','(--version)-V'}'[display version information]' \
	{'(--quiet -q)*--verbose','(--quiet -q)*-v'}'[increase verbosity]' \
	{'(-x)--nth','(--nth)-x'}'[block decode interval]:number:' \
	{'(-y)--ntimes','(--ntimes)-y'}'[block repeat count]:number:' \
	{'(-z)--shuffle','(--shuffle)-z'}'[play input audio in random order]' \
	'*:files:->files' && return 0

case "$state" in
	files)
	_description files expl 'ogg vorbis file'
	_files "$expl[@]" -g '*.ogg'
	;;
	devopts)
	_setup devopts
	_tags devopts
	_description devopts expl 'device options'
	compadd "$expl[@]" -S : - dsp dev card buf_size host byteorder
	;;
esac


Messages sorted by: Reverse Date, Date, Thread, Author