1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-12-29 16:25:35 +01:00

add new _pkgtool, _rar and _vorbis functions from 4.1

This commit is contained in:
Oliver Kiddle 2003-08-22 15:03:11 +00:00
parent c25a63a02f
commit 3b01959864
6 changed files with 248 additions and 2 deletions

View file

@ -47,6 +47,13 @@
2003-07-24 Oliver Kiddle <opk@zsh.org>
* 18901: baptiste daroussin (and Nikolai Weibull, 18894):
Completion/Unix/Command/_vorbis: new completions for ogg vorbis
* 18893: baptiste daroussin: Completion/Linux/Command/_pkgtool,
Completion/Unix/Command/_rar: improved _pkgtool and new
completions for rar/unrar
* 18900: Completion/Linux/Command/_iptables,
Completion/Unix/Command/_nmap: new iptables and nmap completions
@ -105,6 +112,13 @@
* 18811: Completion/Unix/Type/_files: needed to quote % in
substitution as users/6154 caused it to be interpreted as an anchor
2003-07-04 Peter Stephenson <pws@csr.com>
* 18807: baptiste daroussin <daroussi@ece.fr>:
Completion/Linux/Command/.distfiles,
Completion/Linux/Command/_pkgtool: Completion for Slackware
package management tool.
2003-07-02 Oliver Kiddle <opk@zsh.org>
* 18520, 13691 (Mario Lang), 13701 (Sven):

View file

@ -1,4 +1,4 @@
DISTFILES_SRC='
.distfiles
_losetup _modutils _mondo _uml _valgrind
_iptables _losetup _modutils _mondo _pkgtool _uml _valgrind
'

View file

@ -0,0 +1,53 @@
#compdef installpkg upgradepkg removepkg pkgtool explodepkg makepkg
case "$service" in
installpkg)
_arguments \
'-warn[warn if files would be overwritten, but do not install]' \
'-root=[specify alternate install location]:root directory:_path_files -/' \
'-infobox[use dialog to draw an info box]' \
'-menu[confirm package installation with a menu]' \
"-ask[always ask on package installation regardless of package's priority]" \
'-priority[provide a priority for the entire package list to use]:priority list:(ADD REC OPT SKP)' \
'-tagfile[specify a different file to use for package priorities]:tagfile:_files -/' \
'*:package file:_files -g \*.tgz'
;;
removepkg)
_arguments \
'-warn[list which files & directories would be removed, skip actual removal]' \
'-preserve[reconstruct complete package subtree in /tmp/preserved_packages]' \
'-copy[construct a copy of the package in /tmp/preserved_packages]' \
'-keep[save the intermediate files created]' \
'*:package:_files -W /var/log/packages/ -/'
;;
upgradepkg)
_arguments \
'--install-new[install new packages in addition to upgrading existing ones]' \
'--reinstall[upgrade even when the same version is already installed]' \
'--verbose[show all the gory details of the upgrade]' \
'*:package file:_files -g \*.tgz'
;;
explodepkg)
_wanted file expl 'package file' _files -g \*.tgz
;;
makepkg)
_arguments -s \
'(--linkadd -l)'{--linkadd,-l}'[move symlinks into doinst.sh]:answer:(y n)' \
'(--chown -c)'{--chown,-c}'[reset all permissions to root:root 755]:answer:(y n)'
;;
pkgtool)
_arguments \
"-sets[install the disk sets A, B, C]" \
"(-source_device)-source_mounted[don't attempt to unmount and remount source device with each disk]" \
'-ignore_tagfile[install every package encountered regardless of tagfiles]' \
'-tagfile[specify tagfile to be used for the installation]:tagfile:_files -/' \
'-source_dir[specify directory containing each disk subdirectory]:source directory:_path_files -/' \
'-target_dir[specify directory where the target root directory is located]:target directory:_path_files -W -/' \
'(-source_mounted)-source_device[specify source device to install from]:source device:{compadd "$expl[@]" /dev/*}'
;;
esac

View file

@ -20,5 +20,5 @@ _chkconfig _cdcd _irssi _sccs _texinfo _ant
_global _global_tags _figlet _ifconfig _last _larch
_lsof _mt _xmlsoft _elinks _tidy _python
_antiword _renice _sablotron _cdrecord _aap _du
_subversion
_rar _vorbis _subversion
'

View file

@ -0,0 +1,88 @@
#compdef rar unrar
local common
common=(
'-ad[append archive name to destination path]'
'-ap[set path inside archive]'
'-av\-[disable authenticity verification check]'
'-c\-[disable comments show]'
'-cfg\-[disable read configuration]'
'-cl\-[convert names to lower case]'
'-cu[convert names to upper case]'
'-dh[open shared files]'
'-ep[exclude paths from name]'
'-f[freshen files]'
'-idp[disable percentage display]'
'-ierr[send all messages to stderr]'
'-inul[disable all messages]'
'-kb[keep broken extracted files]'
'-o\+[overwrite existing files]'
'-o\-[do not overwrite existing files]'
'-ow[save or restore file owner and group]'
'-p\-[do not query password]'
'-r[recurse subdirectorie]'
'-ta[process files modified after <date> in YYYYMMDDHHMMSS format]'
'-tb[process files modified before <date> in YYYYMMDDHHMMSS format]'
'-tn[process files newer than <time>]'
'-to[process files older than <time>]'
'-u[update files]'
'-v[create volumes with size autodetection or list all volumes]'
'-ver[file version control]'
'-vp[pause before each volume]'
'-x[exclude specified file]'
'-y[assume yes answer to all queries]'
)
case $service in
unrar)
if (( CURRENT == 2 )); then
_wanted commands expl 'rar command' compadd e l lt p t v vt x && return
else
_arguments "$common[@]" '*:RAR files:_files -g \*.rar' && return
fi
;;
rar)
if (( CURRENT == 2 )); then
_wanted commands expl 'rar command' compadd \
a c cf cw d e f i k l lt m mf p r rc rr rv s t u v vt x && return
else
_arguments -s \
'-ag[generate archive name using the current date]' \
'-as[synchronize archive contents]' \
'-av[put authenticity verification (registered versions only)]' \
'-df[delete files after archiving]' \
'-ds[disable name sort for solid archive]' \
'-e[set file exclude attributes]' \
'-ed[do not add empty directories]' \
'-en[do not put end of archive block]' \
'-ep1[exclude base directory from names]' \
'-ep2[expand paths to full]' \
'-hp[encrypt both file data and headers]' \
'-ilog[log errors to file (registered versions only)]' \
'-isnd[enable sound]' \
'-k[lock archive]' \
'-m+[set compression level]:compression level:(( 0\:store 1\:fastest 2\:fast 3\:normal 4\:good 5\:maximal ))' \
'-md+[dictionary size]:dictionary size (KB):( 64 128 256 512 1024 2048 4096 a b c d e f g )' \
'-ms[specify file types to store]' \
'-ol[save symbolic links as the link instead of the file]' \
'-p[set password]' \
'-r0[recurse subdirectories for wildcard names only]' \
'-rr[add data recovery record]' \
'-rv[create recovery volumes]' \
'-s[create solid archive]' \
'-se[create solid archive using extension]' \
'-sv[create solid archive using volumes]' \
'-s\-[disable solid archiving]' \
'-sfx[create SFX archive]' \
'-t[test files after archiving]' \
'-tk[keep original archive time]' \
'-tl[set archive time to latest file]' \
'-vn[use the old style volume naming scheme]' \
'-w+[assign work directory]:work directory:_files -/' \
"$common[@]" \
'-z+[read archive comment from file]:comment file:_files' \
'*:files:_files' && return
fi
;;
esac

View file

@ -0,0 +1,91 @@
#compdef oggenc ogg123 ogginfo oggdec
local expl ret=1
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
case $state in
oggfiles)
_wanted files expl 'ogg vorbis file' \
_files "$expl[@]" -g '(#i)*.ogg' && return
;;
devopts)
if compset -p '*:'; then
_message value
else
_wanted devopts expl 'device option' \
compadd -S : - dsp dev card buf_size host byteorder && return
fi
;;
esac
return ret