From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12369 invoked by alias); 2 May 2018 06:42:13 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42743 Received: (qmail 25518 invoked by uid 1010); 2 May 2018 06:42:12 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(205.235.26.22):SA:0(0.2/5.0):. Processed in 2.250295 secs); 02 May 2018 06:42:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=ri/7=HV=yahoo.co.uk=okiddle@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1525243306; bh=TKpJNYf7t03vs0Ds+86Qa6u1um91bsQN6k0xioa8a5U=; h=From:To:Subject:Date:From:Subject; b=rYLmZT6Ou78xLhN1x+xsvLkB12fax6pN7QknAVq/MDlh7KurK7K0wibKP0A4plJ1LiMO8NUQ1ICeXMNzmCtwC3gLEofRSB3UQdcOE4+71vSICjYnBBIQs0ViqH3ALW1b2gTBv7c0TLRHhBjeQSEfaHtKfVQQK+a22hxRQMyNtrTkeDAkaZ+tvf4W54Nk7tjr6p/pvCYST0BloP/RMMh8AX+Iqo4xYzDt37D2V2/LipZz5/5K9gT4BK90i/lZ+splvekTlnAfNGT7v0r7uPD1EIP4MagonLTHJ/ZQb2tMODAyV4MFlAKVqwFiquAfvI3cBtK+3G8kqVdMF6SD7phcVw== X-YMail-OSG: wv6oH5MVM1lWQdhiORzNgJXElOO7hYNGnLNJd5XeKL3RZAfxIQ_TyyakQyM1VKR qFgiQEFhu6.3vxqGX_LfrTcbnFU9g9R5nBGRUHzCd27IsoECXk1qk2YmJ_zHpEYdowjnS5Ln1ipZ Vpm_nUgQUinslxhIMSTkOFctH7I_aLJW2gBse7l8icGsKeeoqWO8cXhn9soBQc4IZ51io.A228n. ZM9DKIQOUqKL6b268B_XaaZHv0YdQM_y1M.ROr__30v2NQcDmRk2fk047WfnuWnoi.HqehLEs3wh W7zEQkVtdir55b7mpumIQLA8ntIfyO6vrGOeX660I58ph4J_DTYto_8KoIFmdlwcLSNCOE79QyPe 6yU42qFYjJqTvpgqQY4A51DmjMw1a1fYMwGGtlVHLPcJFaoHJY6jcU3mi2pvjYC4t6cUZto17NuY 1JLB.MVSD1IPLwj4xBmeeBvSWKT.UkL8KbUhzCpasJMVu280TUq7oCziocQpUs.7p1QFiXwwoT1V _rQzhh4q1zZFgKAOO3l9Om8VY0q.weV0nDMV3elFoj.zDjwBjd0gqqR6UXxoGL7HUEFrDx9sxDyf PTkkPy3LzWad.BzMe65MxJST2_5ANUObskheGOd7fagGBtYVFxBPMrT9__b76zblFXjgB From: Oliver Kiddle To: Zsh workers Subject: PATCH: update vorbis-tools completions MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <658.1525213889.1@thecus> Content-Transfer-Encoding: quoted-printable Date: Wed, 02 May 2018 00:31:29 +0200 Message-ID: <659.1525213889@thecus> This updates completions for vorbis-tools. Until now, we've had a separate function for vorbiscomment but it is all part of the same vorbis-tools so is now handled in _vorbis alongside the other tools. I wrote that completely from scratch without reference to the old function so it isn't necessary to preserve the comment at the top of _vorbiscomment. It had its own licence which in some cases adds extra work for people trying to package zsh. Oliver diff --git a/Completion/Unix/Command/_vorbis b/Completion/Unix/Command/_vo= rbis index cb3e3f9d8..6c94469f9 100644 --- a/Completion/Unix/Command/_vorbis +++ b/Completion/Unix/Command/_vorbis @@ -1,90 +1,148 @@ -#compdef oggenc ogg123 ogginfo oggdec +#compdef oggenc ogg123 ogginfo oggdec vorbiscomment = -local expl ret=3D1 +local curcontext=3D"$curcontext" ret=3D1 +local -a alts expl state line suf = case $service in oggenc) - _arguments -s \ - '(- *)'{-h,--help}'[show help]' \ - '(- *)'{-v,--version}'[display version information]' \ + _arguments -C -s -S \ + '(-Q --quiet)'{-Q,--quiet}'[produce no output to stderr]' \ + '(- *)'{-h,--help}'[display usage information]' \ + '(- *)'{-V,--version}'[display version information]' \ + '(-k --skeleton)'{-k,--skeleton}'[add an Ogg Skeleton bitstream]' \ '(-r --raw)'{-r,--raw}'[assume input data is raw, little-endian wit= h no header information]' \ - '(-B --raw-bits)'{-B+,--raw-bits=3D}'[set raw mode input sample siz= e in bits]:sample size:(8 16)' \ - '(-C --raw-chan)'{-C+,--raw-chan=3D}'[set raw mode input number of = channels]:number of channels' \ - '(-R --raw-rate)'{-R+,--raw-rate=3D}'[set raw mode input sample rat= e]:sample rate:(44100 48000)' \ - '--raw-endianness[set raw mode endianness]:endianness:((0\:big\ end= ian 1\:little\ endian))' \ - '(-Q --quiet)'{-Q,--quiet}'[quiet mode]' \ + '(-B --raw-bits)'{-B+,--raw-bits=3D}'[set raw mode input sample siz= e in bits]:sample size [16]:(8 16)' \ + '(-C --raw-chan)'{-C+,--raw-chan=3D}'[set raw mode input number of = channels]:number of channels [2]' \ + '(-R --raw-rate)'{-R+,--raw-rate=3D}'[set raw mode input sample rat= e]:sample rate [44100]:(44100 48000)' \ + '--raw-endianness=3D[set raw mode endianness]:endianness [0]:((0\:b= ig\ endian 1\:little\ endian))' \ '(-b --bitrate)'{-b+,--bitrate=3D}'[set encoding to the bitrate clo= sest to that specified]:bitrate (kb/s)' \ + '--managed[enable the bitrate management engine]' \ '(-m --min-bitrate)'{-m+,--min-bitrate=3D}'[set minimum bitrate]:bi= trate (kb/s)' \ '(-M --max-bitrate)'{-M+,--max-bitrate=3D}'[set maximum bitrate]:bi= trate (kb/s)' \ - '--managed[turn off the normal VBR encoding]' \ + '*--advanced-encode-option=3D:option name:_values option + "lowpass_frequency[set the lowpass frequency]\:frequency (kHz)" + "impulse_noisetune[set a noise floor bias]\:bias (-15..0)" + "bitrate_hard_max[set the allowed bitrate maximum for the encoded= file]\:bitrate (kb/s)" + "bitrate_hard_min[set the allowed bitrate minimum for the encoded= file]\:bitrate (kb/s)" + "bit_reservoir_bits[set the total size of the bit reservoir]\:bit= s" + "bit_reservoir_bias[set the behavior bias of the bit reservoir]\:= bias (0..1)" + "bitrate_average[set the average bitrate for the file]\:bitrate (= kb/s)" + "bitrate_average_damping[set the reaction time for the average bi= trate tracker]\:time (seconds)" + "disable_coupling[disable use of channel coupling for multichanne= l encoding]"' \ '(-q --quality)'{-q+,--quality=3D}'[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)' \ + '--resample=3D[resample input to the given sample rate before encod= ing]:sample rate (Hz)' \ '--downmix[down mix input from stereo to mono]' \ - '--advanced-encode-option:option name:_values option "bitrate_avera= ge_window[set the managed bitrate window]\:number (seconds)" "lowpass_freq= uency[set the lowpass frequency]\:frequency (kHz)"' \ - '(-s --serial)'{-s+,--serial=3D}'[force a specific serial number in= the output stream]' \ + '--scale=3D[set input scaling factor]:scaling factor' \ + '(-s --serial)'{-s+,--serial=3D}'[force a specific serial number in= the output stream]:serial number' \ "--discard-comments[don't copy comments from FLAC file to output Og= g Vorbis file]" \ + '--ignorelength[ignore the datalength in Wave headers]' \ '(-o --output)'{-o+,--output=3D}'[write the Ogg Vorbis stream to ou= tput_file]:files:->oggfiles' \ '(-n --names)'{-n+,--names=3D}'[specify pattern for producing filen= ames]:string' \ '(-X --name-remove)'{-X+,--name-remove=3D}'[remove specified charac= ters from output filenames]:characters' \ '(-P --name-replace)'{-P+,--name-replace=3D}'[specify replacement c= haracters for those removed]:characters' \ - '(-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 com= ments 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 fie= ld to the given value]:track number' \ - '(-t --title)'{-t+,--title}'[set the track title comment field to t= itle]:title' \ - '(-l --album)'{-l+,--album}'[set the album comment field to album]'= \ + '--utf8[interpret command-line parameters as already being UTF-8 en= coded]' \ + \*{-c+,--comment=3D}'[add the string comment as an extra comment]:c= omment' \ + \*{-d+,--date=3D}'[set the date comment field to the given value]:d= ate' \ + \*{-N+,--tracknum=3D}'[set the track number comment field to the gi= ven value]:track number' \ + \*{-t+,--title=3D}'[set the track title comment field to title]:tit= le' \ + \*{-l+,--album=3D}'[set the album comment field to album]:album' \ + \*{-a+,--artist=3D}'[set the artist comment field in the comments t= o artist]:artist' \ + \*{-G+,--genre=3D}'[set the genre comment field in the comments to = genre]:genre' \ + \*{-L+,--lyrics=3D}'[include lyrics from specified file]:lyrics fil= e:_files -g "*.(srt|lrc)(-.)"' \ + \*{-Y+,--lyrics-language=3D}'[specify language for the lyrics]:lang= uage' \ '*:input file:_files -g "(#i)*.(flac|wav|aiff)(-.)"' && ret=3D0 ;; ogg123) - _arguments -C -s \ - '(- *)'{-h,--help}'[show help]' \ - '(- *)'{-V,--version}'[display version information]' \ - \*{-d+,--device}'[output device]:device:((null\:discard\ all\ data = oss\:open\ sound\ system sun\:sun\ audio alsa\:advanced\ linux\ sound\ arc= hitecture irix\:IRIX\ audio arts\:aRts\ sound\ daemon esd\:enlightened\ so= und\ daemon au\:sun\ audio\ file raw\:raw\ sample wav\:wav\ file))' \ + _arguments -C -s -S \ + \*{-d+,--device=3D}'[output device]:device:(aixs alsa arts au esd i= rix macosx nas null oss pulse raw roar sndio sun wav wmm)' \ \*{-f+,--files=3D}'[output filename for a previously specified file= device]:output filename:_files -g "(#i)*.(wav|au|raw)(-.)"' \ - '(-k --skip)'{-k+,--skip}"[skip the first 'n' seconds (or to hh:mm:= ss)]:seconds" \ - '(-K --end)'{-K+,--end}"[end at 'n' seconds (or hh:mm:ss)]: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=3D}'[set delay between two SIGINTs to qu= it]:delay (ms)' \ - '(-@ --list)'{-@+,--list}'[play all of the files from a playlist]:p= laylist:_files' \ - '--audio-buffer=3D[size of output audio buffer]:kilobytes' \ + '--audio-buffer=3D[specify size of output audio buffer]:size (kilob= ytes)' \ \*{-o,--device-option=3D}'[assign device option values]:device opti= on:->devopts' \ - '*:sound file or directory:_files -g "(#i)*.(ogg|flac|spx)"' && ret= =3D0 + '(-@ --list)'{-@+,--list=3D}'[play all of the files from a playlist= ]:playlist:_files' \ + '(-r --repeat)'{-r,--repeat}'[repeat playlist indefinitely]' \ + '(-R --remote)'{-R,--remote}'[use remote control interface]' \ + '(-z --shuffle -Z --random)'{-z,--shuffle}'[shuffle list of files b= efore playing]' \ + '(-Z --random -z --shuffle -r --repeat)'{-Z,--random}'[play files r= andomly until interrupted]' \ + '(-b --buffer)'{-b+,--buffer=3D}'[specify size of input buffer (HTT= P only)]:size (kilobytes)' \ + '(-p --prebuffer)'{-p+,--prebuffer=3D}'[delay playback until propor= tion of buffer filled (HTTP only)]:percent' \ + '(-k --skip)'{-k+,--skip=3D}"[skip up to specified time]:start time= ([[hh\:]mm\:]ss[.d])" \ + '(-K --end)'{-K+,--end=3D}"[end after specified time]:end time ([[h= h\:]mm\:]ss[.d])" \ + '(-x --nth)'{-x+,--nth=3D}"[play every 'n'th block]:number"\ + '(-y --ntimes)'{-y+,--ntimes=3D}"[repeat every 'n'th block]:number"= \ + '(-l --delay)'{-l+,--delay=3D}'[set delay between two SIGINTs to qu= it]:delay (ms)' \ + '(- *)'{-h,--help}'[display usage information]' \ + '(-q --quiet -v --verbose)'{--quiet,-q}'[quiet mode]' \ + '(-q --quiet)*'{-v,--verbose}'[increase verbosity]' \ + '(- *)'{-V,--version}'[display version information]' \ + \*{-c-,--config=3D-}'[specify config options]: :_values option + "default_device\:device" + "shuffle\:value\:(0 1)" + "repeat\:value\:(0 1)"' \ + '*:sound file or directory:->urls-or-files' && ret=3D0 ;; ogginfo) - _arguments \ - '(- *)-h[show a help and usage message]' \ + _arguments -S \ + '(- *)-h[display usage information]' \ + '(- *)-V[display version information]' \ '(-)*-q[quiet mode]' \ '(-)-v[verbose mode]' \ - '*:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' && ret=3D0 + '(-h)*:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' && ret=3D0 ;; oggdec) - _arguments -s \ + _arguments -s -S \ '(-Q --quiet)'{-Q,--quiet}'[quiet mode]' \ - '(- *)'{-h,--help}'[print help information]' \ - '(- *)'{-v,--version}'[display version information]' \ + '(- *)'{-h,--help}'[display usage information]' \ + '(- *)'{-V,--version}'[display version information]' \ '(-b --bits)'{-b+,--bits=3D}'[bits per sample]:bits per sample:(8 1= 6)' \ - '(-e --endian)'{-e+,--endian=3D}'[set endianness for 16-bit output]= :endianness:((0\:\(default\)\ little-endian\ \(Intel\ byte\ order\) 1\:big= -endian\ \(sane\ byte\ order\)))' \ - '(-R --raw)'{-R+,--raw=3D}'[output in raw format]' \ + '(-e --endianness)'{-e+,--endianness=3D}'[set endianness for 16-bit= output]:endianness [0]:((0\:little-endian\ \(Intel\ byte\ order\) 1\:big-= endian\ \(sane\ byte\ order\)))' \ + '(-s --sign)'{-s+,--sign=3D}'[set signedness for output]:signedness= [1]:((0\:unsigned 1\:signed))' \ + '(-R --raw)'{-R,--raw}'[output in raw format]' \ '(-o --output)'{-o+,--output=3D}'[write output to specified filenam= e]:output filename:_files' \ - '(-s --sign)'{-s+,--sign=3D}'[set signedness for output]:signedness= :((0\:unsigned 1\:signed\ \(default\)))' \ '*:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' && ret=3D0 ;; + vorbiscomment) + _arguments -s -S \ + '(-l --list)*'{-t+,--tag=3D}'[specify a comment tag on the commandl= ine]:tag=3Dvalue' \ + '(-c --commentfile)'{-c+,--commentfile=3D}'[specify comment file]:f= ile:_files' \ + '(-R --raw)'{-R,--raw}'[read and write comments in UTF-8]' \ + '(-e --escapes)'{-e,--escapes}'[use \\n-style escapes to allow mult= iline comments]' \ + '1:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' \ + '(-l --list)2:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' \ + + '(actions)' \ + '(2 -t --tag)'{-l,--list}'[list the comments (default)]' \ + {-a,--append}'[append comments]' \ + {-w,--write}'[write comments, replacing the existing ones]' \ + '(-)'{-h,--help}'[display usage information]' \ + '(-)'{-V,--version}'[display version information]' && ret=3D0 + ;; esac = -if [[ $state =3D devopts ]]; then - 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 +if [[ -n $state ]]; then + case $state in + urls-or-files) + if [[ -prefix 1 (f|ht)tp(|s):// ]]; then + alts=3D( 'urls:URL of sound file:_urls -f -g "*.(#i)(ogg|flax|spx= )(-.)"' ) + else + alts=3D( 'urls:URL of sound file:compadd -S "" ftp:// http:// htt= ps://' ) + fi + _alternative \ + 'files:sound file or directory:_files -g "(#i)*.(ogg|flac|spx)"' = \ + $alts && ret=3D0 + ;; + devopts) + if compset -P 1 '*:'; then + _message -e value value + else + _description device-options expl 'device option' + if ! compset -S ':*'; then + compadd "$expl[@]" - debug verbose quiet && ret=3D0 + suf=3D( -qS : ) + fi + compadd $suf "$expl[@]" - matrix dev buffer_time period_time use_= mmap \ + multi host buf_size dsp server sink byteorder id && ret=3D0 + fi + ;; + esac fi = return ret