mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
88 lines
3.1 KiB
Text
88 lines
3.1 KiB
Text
#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
|