From adf2c2a0b606cae3de93bc2e452edf8213cb1d4a Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 24 Jul 2003 11:52:58 +0000 Subject: 18893, 18901: new completions for rar/unrar and ogg vorbis; improve _pkgtool --- Completion/Linux/Command/_pkgtool | 2 +- Completion/Unix/Command/_rar | 137 ++++++++++++++++++++++++++++++++++++++ Completion/Unix/Command/_vorbis | 99 +++++++++++++++++++++++++++ 3 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 Completion/Unix/Command/_rar create mode 100644 Completion/Unix/Command/_vorbis (limited to 'Completion') diff --git a/Completion/Linux/Command/_pkgtool b/Completion/Linux/Command/_pkgtool index 27d0113ab..dd112680d 100644 --- a/Completion/Linux/Command/_pkgtool +++ b/Completion/Linux/Command/_pkgtool @@ -73,7 +73,7 @@ _slackware_pkg() { '-tagfile[this flag is used to specify from the command line which tagfile should be used for the installation.]:tagfile:_files -/' '-source_dir[used when installing multiple packages from disk sets. This is the directory in which the subdirectories for each disk are found.]:source directory:_path_files -/' '-target_dir[the directory where the target root directory is located. This is '/' when installing on the hard drive, or typically '\''/mnt'\'' when installing from an install disk.]:target directory:_path_files -W -/' - '-source_device[the source device to install from. This is not used if you'\''ve provided the -source_mounted flag. It'\''s usually used when installing from floppy.]:source device:_files -/' + '-source_device[the source device to install from. This is not used if you'\''ve provided the -source_mounted flag. It'\''s usually used when installing from floppy.]:source device:{compadd "$expl[@]" /dev/*}' ) _arguments -s \ $flags[@] diff --git a/Completion/Unix/Command/_rar b/Completion/Unix/Command/_rar new file mode 100644 index 000000000..73b8db3d4 --- /dev/null +++ b/Completion/Unix/Command/_rar @@ -0,0 +1,137 @@ +#compdef rar unrar + + +_rar(){ + case $service in + rar) + _arguments -s \ + '*::rar command:_rar_command' + ;; + unrar) + _arguments -s \ + '*::unrar command:_unrar_command' + ;; + esac +} + +_compression_level() { + compression_level= + _tags compression_level && { compadd "$@" -k compression_level || compadd "$@" ${(kv)=compression_level} } +} + +_dico_size() { + dico_size=(64 128 256 512 1024 2048 4096 a b c d e f g) + _tags dico_size && { compadd "$@" -k dico_size || compadd "$@" ${(kv)=dico_size} } +} + +_unrar_command () { + cmd=(e l lt p t v vt x) + if (( CURRENT == 1 ));then + _tags cmd && { compadd "$@" -k cmd || compadd "$@" ${(kv)=cmd} } + else + _arguments -C \ + '-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 in YYYYMMDDHHMMSS format]'\ + '-tb[Process files modified before in YYYYMMDDHHMMSS format]'\ + '-tn[Process files newer than