From b84399b9cbb93f199d695d7cb264c44178a8d5e0 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 31 Jul 2003 15:26:13 +0000 Subject: tidy up of many completions (updates, fixes, improvements and plain aesthetics) --- Completion/Unix/Command/_vorbis | 184 +++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 96 deletions(-) (limited to 'Completion/Unix/Command/_vorbis') diff --git a/Completion/Unix/Command/_vorbis b/Completion/Unix/Command/_vorbis index 8dd078b0d..93122b91c 100644 --- a/Completion/Unix/Command/_vorbis +++ b/Completion/Unix/Command/_vorbis @@ -1,99 +1,91 @@ -#compdef oggenc ogg123 ogginfo oggdec +#compdef oggenc ogg123 ogginfo oggdec -_advanced_option() { - _values "options name" \ - 'bitrate_average_window[set the managed bitrate window to NN seconds.]:number:'\ - 'lowpass_frequency[set the lowpass frequency to NN kHz.]:number:' -} -_vorbis (){ - local expl - case $service in - oggenc) - _arguments -C -s \ - {'(--help)-h','(-h)--help'}'[show help]'\ - {'(--raw)-r','(-r)--raw'}'[assume input data is raw little-endian audio data with no header information.]'\ - {'(--raw-bits=)-B','(-B)--raw-bits='}'[sets raw mode input sample size in bits.]:sample size:(8 16)'\ - {'(--raw-chan=)-C','(-C)--raw-chan='}'[sets raw mode input number of channels.]:number of channels:'\ - {'(--raw-rate=)-R','(-R)--raw-rate='}'[sets raw mode input samplerate.]:samplerate:(44100 48000)'\ - '--raw-endianness[sets raw mode endianness]:endianness:(( 0\:big\ endian 1\:little\ endian ))'\ - {'(--quiet)-Q','(-Q)--quiet'}'[quiet mode.]'\ - {'(--bitrate=)-b','(-b)--bitrate='}'[sets encoding to the bitrate closest to n (in kb/s).]:bitrate in kb/s:'\ - {'(--min-bitrate=)-m','(-m)--min-bitrate='}'[sets minimum bitrate to n (in kb/s).]:bitrate in kb/s:'\ - {'(--max-bitrate=)-M','(-M)--max-bitrate='}'[sets maximum bitrate to n (in kb/s).]:bitrate in kb/s:'\ - '--managed[turn off the normal VBR encoding]'\ - {'(--quality=)-q','(-q)--quality='}'[sets encoding quality.]:quality:(0 1 2 3 4 5 6 7 8 9 10)'\ - '--resample[resample input to the given sample rate (in Hz) before encoding.]:sample rate:'\ - '--downmix[downmix input from stereo to mono.]'\ - '--advanced-encode-option[sets an advanced option.]:option name:_advanced_option'\ - {'(--serial)-s','(-s)--serial'}'[forces a specific serial number in the output stream.]'\ - {'(--output-file=)-o','(-o)--output-file='}'[write the Ogg Vorbis stream to output_file]:files:->oggfiles'\ - {'(--pattern=)-n','(-n)--pattern='}'[produce filenames as this string]:string:'\ - {'*-c','*--comment'}'[add the string comment as an extra comment.]:comment:'\ - {'*-a','*--artist'}'[set the artist comment field in the comments to artist.]:artist:'\ - {'*-G','*--genre'}'[set the genre comment field in the comments to genre.]:genre:'\ - {'*-d','*--date'}'[sets the date comment field to the given value.]:date:'\ - {'*-N','*--tracknum'}'[sets the track number comment field to the given value.]:track number:'\ - {'*-t','*--title'}'[set the track title comment field to title.]:title:'\ - {'*-l','*--album'}'[set the album comment field to album.]'\ - '*:files:->wavfiles' && return 0 - ;; - ogg123) - _arguments -C -s \ - {'(-h)--help','(--help)-h'}'[show help]'\ - {'(--version)-V','(-V)--version'}'[display version information.]'\ - {'(-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"))' \ - {'(--files=)-f','(-f)--files='}'[output filename for a previously specified file device.]:output filename:_files'\ - {'(--skip)-k','(-k)--skip'}'[skip the first '\''n'\'' seconds.]:seconds:'\ - {'(--buffer)-b','(-b)--buffer'}'[size of input buffer.]:kilobytes:'\ - {'(--prebuffer)-p','(-p)--prebuffer'}'[prebuffer percentage.]:percent:'\ - {'(--quiet -q)*-v','(--quiet -q)*--verbose'}'[increase verbosity.]'\ - {'(--verbose -v --quiet)-q','(-q --verbose -v)--quiet'}'[quiet mode.]'\ - {'(--nth)-x','(-x)--nth'}'[block decode intervall.]:number:'\ - {'(--ntimes)-y','(-y)--ntimes'}'[block repeat count.]:number:'\ - {'(--shuffle)-z','(-z)--shuffle'}'[shuffle play.]'\ - {'(--delay=)-l','(-l)--delay='}'[set delay in millisecond.]:milliseconds:'\ - {'(--playlist)-@','(-@)--playlist'}'[Play all of the files from a playlist.]:playlist:_files'\ - '--audio-buffer[size of output audio buffer.]:kilobytes:'\ - {'*-o','*--device-option='}'[assign device option values]:devopts:->devopts'\ - '*:files:->oggfiles' && return 0 - ;; - ogginfo) - _arguments -C -s \ - '-h[show a help and usage message]'\ - '*-q[quiet mode.]'\ - '-v[verbose mode.]'\ - '*:files:->oggfiles' && return 0 - ;; - oggdec) - _arguments -C -s \ - {'(--quiet)-q','(-q)--quiet'}'[quiet mode.]'\ - {'(--help)-h','(-h)--help'}'[print help message.]'\ - {'(--version)-v','(-v)--version'}'[display version information.]'\ - {'(--bits=)-b','(-b)--bits='}'[bits per sample.]:bits per sample:(8 16)'\ - {'(--endian=)-e','(-e)--endian'}'[set endianness for 16-bit output.]:endianness:(( 0\:\(default\)\ is\ little-endian\ \(Intel\ byte\ order\). 1\:is\ big-endian\ \(sane\ byte\ order\). ))'\ - {'(--raw=)-R','(-R)--raw='}'[output in raw format.]'\ - {'(--output=)-o','(-o)--output='}'[write output to specified filename.]:output filename:_files'\ - {'(--sign=)-s','(-s)--sign='}'[set signedness for output.]:signedness:(( 0\:unsigned 1\:signed\ \(default\) ))'\ - '*:files:->oggfiles' && return 0 - ;; - esac +local expl ret=1 - case $state in - oggfiles) - _description files expl 'ogg vorbis files' - _files "$expl[@]" -g '*.ogg' - ;; - wavfiles) - _description files expl 'wav files' - _files "$expl[@]" -g '*.wav' - ;; - devopts) - _setup devopts - _tags devopts - _description devopts expl 'device options' - compadd "$expl[@]" -S : - dsp dev card buf_size host byteorder - ;; - esac -} +case $service in + oggenc) + _arguments -s \ + '(-)'{-h,--help}'[show help]' \ + '(-r --raw)'{-r,--raw}'[assume input data is raw little-endian audio data with no header information]' \ + '(-B --raw-bits)'{-B,--raw-bits=}'[set raw mode input sample size in bits]:sample size:(8 16)' \ + '(-C --raw-chan)'{-C,--raw-chan=}'[set raw mode input number of channels]:number of channels' \ + '(-R --raw-rate)'{-R,--raw-rate=}'[set raw mode input sample rate]:sample rate:(44100 48000)' \ + '--raw-endianness[set raw mode endianness]:endianness:((0\:big\ endian 1\:little\ endian))' \ + '(-Q --quiet)'{-Q,--quiet}'[quiet mode]' \ + '(-b --bitrate)'{-b,--bitrate=}'[set encoding to the bitrate closest to that specified]:bitrate (kb/s)' \ + '(-m --min-bitrate)'{-m,--min-bitrate=}'[set minimum bitrate]:bitrate (kb/s)' \ + '(-M --max-bitrate)'{-M,--max-bitrate=}'[set maximum bitrate]:bitrate (kb/s)' \ + '--managed[turn off the normal VBR encoding]' \ + '(-q --quality)'{-q,--quality=}'[set encoding quality]:quality:(0 1 2 3 4 5 6 7 8 9 10)' \ + '--resample[resample input to the given sample rate before encoding]:sample rate (Hz)' \ + '--downmix[down mix input from stereo to mono]' \ + '--advanced-encode-option:option name:_values option "bitrate_average_window[set the managed bitrate window]\:number (seconds)" "lowpass_frequency[set the lowpass frequency]\:frequency (kHz)"' \ + '(-s --serial)'{-s,--serial}'[force a specific serial number in the output stream]' \ + '(-o --output-file)'{-o,--output-file=}'[write the Ogg Vorbis stream to output_file]:files:->oggfiles' \ + '(-n --pattern)'{-n,--pattern=}'[specify pattern for producing filenames]:string' \ + '(-c --comment)'{-c,--comment}'[add the string comment as an extra comment]:comment' \ + '(-a --artist)'{-a,--artist}'[set the artist comment field in the comments to artist]:artist' \ + '(-G --genre)'{-G,--genre}'[set the genre comment field in the comments to genre]:genre' \ + '(-d --date)'{-d,--date}'[set the date comment field to the given value]:date' \ + '(-N --tracknum)'{-N,--tracknum}'[set the track number comment field to the given value]:track number' \ + '(-t --title)'{-t,--title}'[set the track title comment field to title]:title' \ + '(-l --album)'{-l,--album}'[set the album comment field to album]' \ + '*:wav file:_files -g "(#i)*.wav"' && ret=0 + ;; + ogg123) + _arguments -C -s \ + '(-h --help)'{-h,--help}'[show help]' \ + '(-)'{-V,--version}'[display version information]' \ + '(-d --device)'{-d,--device}'[output device]:device:((null\:discard\ 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 --files)'{-f,--files=}'[output filename for a previously specified file device]:output filename:_files' \ + '(-k --skip)'{-k,--skip}'[skip the first '\''n'\'' seconds]:seconds' \ + '(-b --buffer)'{-b,--buffer}'[size of input buffer]:kilobytes' \ + '(-p --prebuffer)'{-p,--prebuffer}'[prebuffer percentage]:percent' \ + '(-q --quiet)'{*-v,*--verbose}'[increase verbosity]' \ + '(-q --quiet -v --verbose)'{--quiet,-q}'[quiet mode]' \ + '(-x --nth)'{-x,--nth}'[block decode intervall]:number' \ + '(-y --ntimes)'{-y,--ntimes}'[block repeat count]:number' \ + '(-z --shuffle)'{-z,--shuffle}'[shuffle play]' \ + '(-l --delay)'{-l,--delay=}'[set delay]:delay (ms)' \ + '(-@ --playlist)'{-@,--playlist}'[play all of the files from a playlist]:playlist:_files' \ + '--audio-buffer[size of output audio buffer]:kilobytes' \ + {'*-o','*--device-option='}'[assign device option values]:device option:->devopts' \ + '*:files:->oggfiles' && ret=0 + ;; + ogginfo) + _arguments -C -s \ + '-h[show a help and usage message]' \ + '*-q[quiet mode]' \ + '-v[verbose mode]' \ + '*:files:->oggfiles' && ret=0 + ;; + oggdec) + _arguments -C -s \ + '(-q --quiet)'{-q,--quiet}'[quiet mode]' \ + '(-)'{-h,--help}'[print help information]' \ + '(-)'{-v,--version}'[display version information]' \ + '(-b --bits)'{-b,--bits=}'[bits per sample]:bits per sample:(8 16)' \ + '(-e --endian)'{-e,--endian=}'[set endianness for 16-bit output]:endianness:((0\:\(default\)\ little-endian\ \(Intel\ byte\ order\) 1\:big-endian\ \(sane\ byte\ order\)))' \ + '(-R --raw)'{-R,--raw=}'[output in raw format]' \ + '(-o --output)'{-o,--output=}'[write output to specified filename]:output filename:_files' \ + '(-s --sign)'{-s,--sign=}'[set signedness for output]:signedness:((0\:unsigned 1\:signed\ \(default\)))' \ + '*:files:->oggfiles' && ret=0 + ;; +esac -_vorbis "$@" +case $state in + oggfiles) + _wanted files expl 'ogg vorbis file' \ + _files "$expl[@]" -g '(#i)*.ogg' && return + ;; + devopts) + if compset -p '*:'; then + _message -e value value + else + _wanted devopts expl 'device option' \ + compadd -S : - dsp dev card buf_size host byteorder && return + fi + ;; +esac + +return ret -- cgit 1.4.1