fixed issues raised in the review
This commit is contained in:
		
							parent
							
								
									901a787b2d
								
							
						
					
					
						commit
						d930094f84
					
				
							
								
								
									
										139
									
								
								src/_opustools
								
								
								
								
							
							
						
						
									
										139
									
								
								src/_opustools
								
								
								
								
							|  | @ -1,104 +1,71 @@ | ||||||
| #compdef opusenc opusdec opusinfo | #compdef opusenc opusdec opusinfo | ||||||
| # ------------------------------------------------------------------------------ |  | ||||||
| # Copyright (c) 2021 Andre Kugland, MIT License |  | ||||||
| # |  | ||||||
| # Permission is hereby granted, free of charge, to any person obtaining a copy |  | ||||||
| # of this software and associated documentation files (the "Software"), to deal |  | ||||||
| # in the Software without restriction, including without limitation the rights |  | ||||||
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |  | ||||||
| # copies of the Software, and to permit persons to whom the Software is |  | ||||||
| # furnished to do so, subject to the following conditions: |  | ||||||
| # |  | ||||||
| # The above copyright notice and this permission notice shall be included in all |  | ||||||
| # copies or substantial portions of the Software. |  | ||||||
| # |  | ||||||
| # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |  | ||||||
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |  | ||||||
| # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |  | ||||||
| # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |  | ||||||
| # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |  | ||||||
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |  | ||||||
| # SOFTWARE. |  | ||||||
| # ------------------------------------------------------------------------------ |  | ||||||
| # Description |  | ||||||
| # ----------- |  | ||||||
| # |  | ||||||
| #  Completion script for opus-tools (https://opus-codec.org/) |  | ||||||
| # |  | ||||||
| # ------------------------------------------------------------------------------ |  | ||||||
| # Authors |  | ||||||
| # ------- |  | ||||||
| # |  | ||||||
| #  * Andre Kugland (https://github.com/kugland) |  | ||||||
| # |  | ||||||
| # ------------------------------------------------------------------------------ |  | ||||||
| 
 | 
 | ||||||
| case $service in | case $service in | ||||||
|   opusenc) |   opusenc) | ||||||
|     _arguments \ |     _arguments \ | ||||||
|       '1:input file:_files -g "*.(#i)(wav|flac|ogg|aif(|f))(-.)"' \ |       '1:input file:_files -g "*.(#i)(wav|flac|ogg|aif(|f))(-.)"' \ | ||||||
|       '2:output file:_files -g "*.(#i)opus(-.)"' \ |       '2:output file:_files -g "*.(#i)opus(-.)"' \ | ||||||
|       '(- 1 *)'{-h,--help}'[Show usage information]' \ |       '(- 1 *)'{-h,--help}'[show usage information]' \ | ||||||
|       '(- 1 *)'{-V,--version}'[Show version information]' \ |       '(- 1 *)'{-V,--version}'[show version information]' \ | ||||||
|       '(- 1 *)--help-picture[Show help on attaching album art]' \ |       '(- 1 *)--help-picture[show help on attaching album art]' \ | ||||||
|       '--quiet[Enable quiet mode]' \ |       '--quiet[enable quiet mode]' \ | ||||||
|       '--bitrate[Set target bitrate in kbit/s (6-256/channel)]:target bitrate in kbit/s (6-256/channel)' \ |       '--bitrate[set target bitrate per channel]:target bitrate per channel (kbps) (6-256)' \ | ||||||
|       '--comp[Set encoding complexity (0-10)]:encoding complexity (1-10) [10]:(1 2 3 4 5 6 7 8 9 10)' \ |       '--comp[set encoding complexity]:encoding complexity (1-10) [10]:(1 2 3 4 5 6 7 8 9 10)' \ | ||||||
|       '--cvbr[Use constrained variable bitrate encoding]' \ |       '--cvbr[use constrained variable bitrate encoding]' \ | ||||||
|       '--downmix-mono[Downmix to mono]' \ |       '--downmix-mono[downmix to mono]' \ | ||||||
|       '--downmix-stereo[Downmix to stereo (if >2 channels)]' \ |       '--downmix-stereo[downmix to stereo (if >2 channels)]' \ | ||||||
|       '--expect-loss[Set expected packet loss in percent]:expected packet loss in percent [0]' \ |       '--expect-loss[set expected packet loss]:expected packet loss (%) (0-100) [0]' \ | ||||||
|       '--framesize[Set maximum frame size in milliseconds \[20\]]:maximum frame size in milliseconds [20]:(2.5 5 10 20 40 60)' \ |       '--framesize[set maximum frame size]:maximum frame size (milliseconds) [20]:(2.5 5 10 20 40 60)' \ | ||||||
|       '--hard-cbr[Use hard constant bitrate encoding]' \ |       '--hard-cbr[use hard constant bitrate encoding]' \ | ||||||
|       '--max-delay[Set maximum container delay in milliseconds (0-1000) \[1000\]]:maximum container delay in milliseconds (0-1000) [1000]' \ |       '--max-delay[set maximum container delay]:maximum container delay (milliseconds) (0-1000) [1000]' \ | ||||||
|       '--music[Tune low bitrates for music (override automatic detection)]' \ |       '--music[tune low bitrates for music (override automatic detection)]' \ | ||||||
|       '--no-phase-inv[Disable use of phase inversion for intensity stereo]' \ |       '--no-phase-inv[disable use of phase inversion for intensity stereo]' \ | ||||||
|       '--speech[Tune low bitrates for speech (override automatic detection)]' \ |       '--speech[tune low bitrates for speech (override automatic detection)]' \ | ||||||
|       '--vbr[Use variable bitrate encoding (default)]' \ |       '--vbr[use variable bitrate encoding (default)]' \ | ||||||
|       '--album[Set album or collection]:album or collection' \ |       '--album[set album or collection]:album or collection' \ | ||||||
|       '--date[Set date of track (YYYY, YYYY-MM, or YYYY-MM-DD)]:date of track (YYYY, YYYY-MM, or YYYY-MM-DD)' \ |       '--date[set date of track]:date of track (YYYY, YYYY-MM, or YYYY-MM-DD):_dates -f "%F"' \ | ||||||
|       '--discard-comments[Don'\''t keep metadata when transcoding]' \ |       '--discard-comments[discard metadata when transcoding]' \ | ||||||
|       '--discard-pictures[Don'\''t keep pictures when transcoding]' \ |       '--discard-pictures[discard pictures when transcoding]' \ | ||||||
|       '--padding[Reserve n extra bytes for metadata \[512\]]:padding size in bytes' \ |       '--padding[reserve extra bytes for metadata]:padding size (bytes) [512]' \ | ||||||
|       '--title[Set track title]:track title' \ |       '--title[set track title]:track title' \ | ||||||
|       '--tracknumber[Set track number]:track number' \ |       '--tracknumber[set track number]:track number' \ | ||||||
|       '*--artist[Set artist or author, may be used multiple times]:artist or author' \ |       '*--artist[add artist or author]:artist or author' \ | ||||||
|       '*--comment[Add the given string as an extra comment, may be used multiple times]:comment (tag=val)' \ |       '*--comment[add an extra comment]:comment (tag=val)' \ | ||||||
|       '*--genre[Set genre, may be used multiple times]:genre' \ |       '*--genre[add genre]:genre' \ | ||||||
|       '*--picture[Attach album art, may be used multiple times]:album art:_files -g "*.(#i)(jp(|e)g|png|gif)(-.)"' \ |       '*--picture[attach album art]:album art:_files -g "*.(#i)(jp(|e)g|png|gif)(-.)"' \ | ||||||
|       '--ignorelength[Ignore the data length in Wave headers]' \ |       '--ignorelength[ignore the data length in RIFF wav headers]' \ | ||||||
|       '--raw-bits[Set bits/sample for raw input \[16\]]:bits per sample' \ |       '--raw-bits[set bits per sample for raw input]:bits per sample [16]:(8 16 24)' \ | ||||||
|       '--raw-chan[Set number of channels for raw input \[2\]]:number of channels' \ |       '--raw-chan[set number of channels for raw input]:number of channels (1-255) [2]' \ | ||||||
|       '--raw-endianness[Set endianness for raw input, 0 for little endian, 1 for big \[0\]]:endianness:(("0"\:"big endian" "1"\:"little endian"))' \ |       '--raw-endianness[set endianness for raw input]:endianness:(("0"\:"big endian" "1"\:"little endian"))' \ | ||||||
|       '--raw-rate[Set sampling rate for raw input \[48000\]]:sample rate in Hz' \ |       '--raw-rate[set sampling rate for raw input]:sample rate (Hz) (100-768000) [48000]' \ | ||||||
|       '--raw[Interpret input as raw PCM data without headers]' \ |       '--raw[interpret input as raw PCM data without headers]' \ | ||||||
|       '--serial[Force use of a specific stream serial number]:stream serial number' \ |       '--serial[force use of a specific stream serial number]:stream serial number' \ | ||||||
|       '--save-range[Save check values for every frame to a file]:file:_files' \ |       '--save-range[save check values for every frame to a file]:output for check values:_files' \ | ||||||
|       '--set-ctl-int[Pass encoder control]:encoder control' |       '--set-ctl-int[pass encoder control]:encoder control' | ||||||
|     ;; |     ;; | ||||||
|   opusdec) |   opusdec) | ||||||
|     _arguments \ |     _arguments \ | ||||||
|       '1:input file:_files -g "*.(#i)opus(-.)"' \ |       '1:input file:_files -g "*.(#i)opus(-.)"' \ | ||||||
|       '2::output file:_files -g "*.(#i)wav(-.)"' \ |       '2::output file:_files -g "*.(#i)wav(-.)"' \ | ||||||
|       '(- 1 *)'{-h,--help}'[Show usage information]' \ |       '(- 1 *)'{-h,--help}'[show usage information]' \ | ||||||
|       '(- 1 *)'{-V,--version}'[Show version information]' \ |       '(- 1 *)'{-V,--version}'[show version information]' \ | ||||||
|       '(- 1 *)--help-picture[Show help on attaching album art]' \ |       '(- 1 *)--help-picture[show help on attaching album art]' \ | ||||||
|       '--quiet[Enable quiet mode]' \ |       '--quiet[enable quiet mode]' \ | ||||||
|       '--rate[Force decoding at sampling rate in Hz]:sample rate in Hz' \ |       '--rate[force decoding at given sample rate]:sample rate (Hz) (8000-192000)' \ | ||||||
|       '--force-stereo[Force decoding to stereo]' \ |       '--force-stereo[force decoding to stereo]' \ | ||||||
|       '--gain[Adjust output volume in dB (negative is quieter)]:gain in dB (negative is quieter)' \ |       '--gain[adjust output volume]:gain (dB) (negative is quieter)' \ | ||||||
|       '--no-dither[Do not dither 16-bit output]' \ |       '--no-dither[do not dither 16-bit output]' \ | ||||||
|       '--float[Output 32-bit floating-point samples]' \ |       '--float[output 32-bit floating-point samples]' \ | ||||||
|       '--force-wav[Force Wave header on output]' \ |       '--force-wav[force RIFF wav header on output]' \ | ||||||
|       '--packet-loss[Simulate n% random packet loss]:percentage of packets' \ |       '--packet-loss[simulate random packet loss]:packet loss probability (%) (0-100)' \ | ||||||
|       '--save-range[Save check values for every frame to a file]:output:_files' |       '--save-range[save check values for every frame to a file]:output for check values:_files' | ||||||
|     ;; |     ;; | ||||||
|   opusinfo) |   opusinfo) | ||||||
|     _arguments \ |     _arguments \ | ||||||
|       '(- 1 *)-h[Show usage information]' \ |       '(- 1 *)-h[show usage information]' \ | ||||||
|       '(- 1 *)-V[Show version information]' \ |       '(- 1 *)-V[show version information]' \ | ||||||
|       '-q[Make less verbose]' \ |       '*-q[make the output quieter]' \ | ||||||
|       '-v[Make more verbose]' \ |       '*-v[make the output more verbose]' \ | ||||||
|       '*:opus file:_files -g "*.(#i)opus(-.)"' |       '*:opus file:_files -g "*.(#i)opus(-.)"' | ||||||
|     ;; |     ;; | ||||||
| esac | esac | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue