summary refs log tree commit diff
path: root/Completion/Unix/Command/_rar
blob: 9109894372b1102f33dc5c1e3312234ec1593899 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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