From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17238 invoked by alias); 18 Sep 2017 20:08:34 -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: X-Seq: 41728 Received: (qmail 13668 invoked by uid 1010); 18 Sep 2017 20:08:34 -0000 X-Qmail-Scanner-Diagnostics: from sonic302-21.consmr.mail.ir2.yahoo.com 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(87.248.110.84):SA:0(-4.7/5.0):. Processed in 1.38986 secs); 18 Sep 2017 20:08:34 -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=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1505765305; bh=MfqlTK3/8Nv5F77QixFeVO+R5TH/AWPJUqd5Pu9UVvs=; h=From:To:Subject:Date:From:Subject; b=oVoISy/HhEzsCuuRxqGfafD1Yc63BiTHY+o5xE3e+oxPowbGTuPc23KjBd6DmtiPufRLfdVOn1f/24RMUq7EA4SB1qxHhutaSNguHV3cZKZECKraIraB99oSFhCFhOPxxexHI5ayJE9P9i4Y7EeZfQvUbDIQgAbTa05FMNZQy28N5t5fjgqtv8t5zaYgOSZsDIn1/xkJ2Qk1EN5y0TBYdNK1wtYOc8gtiIMot0soZzOboSwTDqpOPoS8CLHjpvIa0VIY0Bf02zSXBqHgi9b/6Yhx/a0qu5oHp2IIq64L+dpbK508AKgqBChgcadffHOvOCYjDYyE85VACFRJS1MOBQ== X-YMail-OSG: CVw0tT8VM1mp_24R3sNpyFGSfnVGh_KNwUsd.LJdEH28c3fwPnfjSarO_HTPhIf qpsuvVjdtqcxkmdreTfJgN.ZJUGhneoNb1nzklEYsxBzOk3I3mbpJz7VdVQGxy.WOcq4zkG4wMRZ okC.S7S.vm0XJOT75C9fIhdWt3nd0H97LrCiu7lPyYQr.QVZgl4McxDoV_bBKSeH9hNPG_4KGsoP 9r.8xhmdZ8_FyyVfy0P1nvakL66Z4.kzO1miAnv2xc4PzwDH7JHLSoDIcuXFRtXnzCoXz3KXXBCI HcVLOUYGeh8P.MCOimcI5rzSrx_w20STZb8RrXsDdwg.k8E2Leb83x9sY07fedQEAXGemuHjFgsD r8bfwurkW1mgs2kH_sNNKmCtOS41skfDdT5v_NCvKRhaVDUNyxR21SGTK.XwIftv.vMWuKmFcmiR mM9O166SXeFKz_6O8Erau7ENPhbNQmAYYjMtqZvnOkamHsdsCXAeHdNv4CLijVYjGYkrRAg-- X-Yahoo-Newman-Id: 413196.78301.bm@smtp106.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: CVw0tT8VM1mp_24R3sNpyFGSfnVGh_KNwUsd.LJdEH28c3f wPnfjSarO_HTPhIfqpsuvVjdtqcxkmdreTfJgN.ZJUGhneoNb1nzklEYsxBz Ok3I3mbpJz7VdVQGxy.WOcq4zkG4wMRZokC.S7S.vm0XJOT75C9fIhdWt3nd 0H97LrCiu7lPyYQr.QVZgl4McxDoV_bBKSeH9hNPG_4KGsoP9r.8xhmdZ8_F yyVfy0P1nvakL66Z4.kzO1miAnv2xc4PzwDH7JHLSoDIcuXFRtXnzCoXz3KX XBCIHcVLOUYGeh8P.MCOimcI5rzSrx_w20STZb8RrXsDdwg.k8E2Leb83x9s Y07fedQEAXGemuHjFgsDr8bfwurkW1mgs2kH_sNNKmCtOS41skfDdT5v_NCv KRhaVDUNyxR21SGTK.XwIftv.vMWuKmFcmiRmM9O166SXeFKz_6O8Erau7EN PhbNQmAYYjMtqZvnOkamHsdsCXAeHdNv4CLijVYjGYkrRAg-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- From: Oliver Kiddle To: Zsh workers Subject: PATCH: update metaflac completion and handle also flac MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3796.1505765296.1@thecus.kiddle.eu> Date: Mon, 18 Sep 2017 22:08:16 +0200 Message-ID: <3797.1505765296@thecus.kiddle.eu> Another completion function where the options had got a bit out-of-date. Completion for flac is also added with this. I'll rename the function to _flac when applying. Oliver diff --git a/Completion/Unix/Command/_metaflac b/Completion/Unix/Command/_metaflac index 65b9eb292..82b6f0160 100644 --- a/Completion/Unix/Command/_metaflac +++ b/Completion/Unix/Command/_metaflac @@ -1,54 +1,120 @@ -#compdef metaflac +#compdef flac metaflac -local _metaflac_opts _metaflac_shorts _metaflac_opers +local shortops common shared blocktypes level -_metaflac_opts=( - '--preserve-modtime' - '--with-filename[prefix output with filename]' - '--no-filename' - '--no-utf8-convert' - '--dont-use-padding[always rewrite the file]' -) -_metaflac_shorts=( - '--show-md5sum' - '--show-min-blocksize' - '--show-max-blocksize' - '--show-min-framesize' - '--show-max-framesize' - '--show-sample-rate' - '--show-channels' - '--show-bps' - '--show-total-samples' - '--show-vendor-tag' - '--show-tag=:FLAC tags' - '--remove-tag=:FLAC tags: ' - '--remove-first-tag=:FLAC tags: ' - '--remove-all-tags' - '--set-tag=:FLAC tag and value: ' - '--import-tags-from=:flat file:_files' - '--export-tags-to=:new file: ' - '--import-cuesheet-from=:file:_files' - '--export-cuesheet-to=:new file: ' - '--add-replay-gain' - '--add-seekpoint=:: ' - '--add-padding=length' - -) -_metaflac_opers=( - '--block-number=:: ' - '--block-type=:: ' - '--except-block-type=:: ' - '--application-data-format=:: ' - '--list' - '--remove' - '--remove-all' - '--merge-padding' - '--sort-padding' +shortops=( + --show-md5sum + --show-min-blocksize + --show-max-blocksize + --show-min-framesize + --show-max-framesize + --show-sample-rate + --show-channels + --show-bps + --show-total-samples + --show-vendor-tag + '--show-tag=:FLAC tag' + '--remove-tag=:FLAC tag' + '--remove-first-tag=:FLAC tag' + --remove-all-tags + '*--set-tag=:FLAC tag and value: ' + '*--set-tag-from-file=:tag' + '--import-tags-from=:flat file:_files' + '--export-tags-to=:new file: ' + '--import-cuesheet-from=:file:_files' + '--export-cuesheet-to=:new file:_files' + '--import-picture-from=:file or specification:_files' + '--export-picture-to=:file:_files' + --scan-replay-gain + --remove-replay-gain + --add-replay-gain + '*--add-seekpoint=:seek point' + '--add-padding=:length (bytes)' ) -_arguments "$_metaflac_opts[@]" \ - "*:FLAC file:_files -g \*.flac\(-.\)" \ - - "shortcuts" \ - "$_metaflac_shorts[@]" \ - - "(operations)" \ - "$_metaflac_opers[@]" +blocktypes=( STREAMINFO PADDING APPLICATION SEEKTABLE VORBIS_COMMENT PICTURE ) +common=( + '--block-number=:block number' + '(--except-block-type)--block-type=:block type:_sequence compadd - $blocktypes' + '(--block-type)--except-block-type=:block type:_sequence compadd - $blocktypes' +) +shared=( + '--no-utf8-convert' + '--preserve-modtime' +) +level=( -{,-compression-level-}{0,1,2,3,4,5,6,7,8} --best --fast ) + +case $service in + flac) + _arguments -s -S $shared \ + '(H -c --stdout)'{-c,--stdout}'[write output to stdout]' \ + '(H -s --silent --totally-silent)'{-s,--silent}"[don't output runtime statistics]" \ + '(H)--totally-silent' \ + '(H -w --warnings-as-errors)'{-w,--warnings-as-errors}'[treat all warnings as errors]' \ + '(H -f --force)'{-f,--force}'[overwrite output files]' \ + '(H -o --output-name -c --stdout)'{-o,--output-name=}'[specify output file name]' \ + '(H)--output-prefix=[prepend specified string to output file names]' \ + '(H)--delete-input-file' \ + '(H)--keep-foreign-metadata' \ + '(H)--skip=[skip initial samples from each input]:skip (mm:ss.ss)' \ + '(H)--until=[stop at specified sample for each input]:stop (+-mm:ss.ss)' \ + '(H)--ogg[use ogg as a transport layer]' \ + '(H)--serial-number=[serial number to use for the FLAC stream]:serial number' \ + '(H --force-aiff-format --force-rf64-format --force-wave64-format)--format-raw-format' \ + '*:file:_files -F line -g "(#i)*.(${${opt_args[(i)decode-*]:+flac|oga}:-wav|aif|aiff|raw|rf64|w64})(-.)"' \ + - 'H' \ + '(-)'{-v,--version}'[display version information]' \ + '(-)'{-h,--help}'[display help information]' \ + '(-)'{-H,--explain}'[display detailed explanation of usage and options]' \ + - encode \ + '(-V --verify)'{-V,--verify}'[verify a correct encoding]' \ + --lax --ignore-chunk-sizes '!--sector-align' --replay-gain \ + '--cuesheet=:file:_files' \ + '--picture=:specification:' \ + \*{-T,--tag}'[add a FLAC tag]:field=value' \ + '--tag-from-file=:field=file' \ + \*{-S,--seekpoint=}':seek point' \ + '(-P --padding)'{-P,--padding=}'[add space for metadata]:length (bytes)' \ + "($level[*])"$^level \ + '(-b --blocksize)'{-b,--blocksize=}'[specify block size in samples]:size:(192 576 1152 2304 4608 256 512 1024 2048 4096 8192 16384)' \ + '(-m --mid-side -M --adaptive-mid-side)'{-m,--mid-side}'[try mid-side coding for each frame]' \ + '(-m --mid-side -M --adaptive-mid-side)'{-M,--adaptive-mid-side}'[adaptive mid-side coding for all frames]' \ + '(-e --exhaustive-model-search)'{-e,--exhaustive-model-search}'[do exhaustive model search]' \ + \*{-A,--apodization=}'[window audio data with given the function]:function:(bartlett bartlett_hann blackman blackman_harris_4term_92dbconnes flattop gauss hamming hann kaiser_bessel nuttall rectangle triangle tukey welch)' \ + '(-l --max-lpc-order)'{-l,--max-lpc-order=}'[specify max LPC order]:order' \ + '(-p --qlp-coeff-precision-search -q --qlp-coeff-precision)'{-p,--qlp-coeff-precision-search}'[exhaustively search LP coeff quantization]' \ + '(-p --qlp-coeff-precision-search -q --qlp-coeff-precision)'{-q,--qlp-coeff-precision=}'[specify precision]:precision (bits)' \ + '(-r --rice-partition-order)'{-r,--rice-partition-order=}'[set min/max residual partition order]:order' \ + '--endian=:byte order:(big little)' \ + '--channels=:channels' \ + '--bps=:bits per sample' \ + '--sample-rate=:sample rate (Hz)' \ + '--sign=:sign of samples [signed]:(signed unsigned)' \ + '--input-size=:size (bytes)' \ + - decode \ + '(-d --decode -t --test -a --analyze)'{-d,--decode}'[decode a FLAC encoded file]' \ + '(-d --decode -t --test -a --analyze --delete-input-file)'{-t,--test}'[test a FLAC encoded file]' \ + '(-d --decode -t --test -a --analyze --delete-input-file)'{-a,--analyze}'[analyze a FLAC encoded file]' \ + '(-d --decode -t --test)'{--residual-text,--residual-gnuplot} \ + '(-F --decode-through-errors)'{-F,--decode-through-errors}'[continue decoding through stream errors]' \ + '--apply-replaygain-which-is-not-lossless=:specification' \ + '--cue=[set the beginning and ending cuepoints to decode]:cue point' \ + '(--force-raw-format --force-rf64-format --force-wave64-format)--force-aiff-format' \ + '(--force-raw-format --force-aiff-format --force-wave64-format)--force-rf64-format' \ + '(--force-raw-format --force-aiff-format --force-rf64-format)--force-wave64-format' \ + ;; + metaflac) + _arguments -S $shared \ + '(--no-filename)--with-filename[prefix output with filename]' \ + '(--with-filename)--no-filename' \ + '--dont-use-padding[always rewrite the file]' \ + "*:FLAC file:_files -g \*.flac\(-.\)" \ + - 'short' $shortops \ + - 'list' $common --list \ + '--application-data-format=:format:(text hexdump)' \ + - 'remove' $common --remove \ + - '(ops)' \ + '(-)--help' '(-)--version' \ + --remove-all --merge-padding --sort-padding + ;; +esac .