summary refs log tree commit diff
path: root/Completion/Unix/Command/_rar
blob: 1e3a26166d237e211235534cd19a6d3eb694cd2b (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#compdef rar unrar

local common expl

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+:password'
  '-p\-[do not query password]'
  '-r[recurse subdirectorie]'
  '-ta+[process files modified after a date]:date (YYYYMMDDHHMMSS)'
  '-tb+[process files modified before a date]:date (YYYYMMDDHHMMSS)'
  '-tn+[process files newer than a specified time]:time'
  '-to+[process files older than a specified time]: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
       _values 'rar command' \
	'e[extract files to current directory]' \
	'l[list archive]' \
	'lt[list archive (technical format)]' \
	'lb[list archive (bare format)]' \
	'p[print file to stdout]' \
	't[test archive files]' \
	'v[verbosely list archive]' \
	'vt[verbosely list archive (technical format)]' \
	'vb[verbosely list archive (bare format)]' \
	'x[extract files with full path]' && return
    else
      _arguments -S \
	'-ep3[expand paths to full including the drive letter]' \
        '-idc[disable ___ display]' \
        '-idd[disable ___ display]' \
        '-idq[disable ___ display]' \
	'-n+:file to include:_files' \
	'-n@+:file of files to include:_files' \
        "$common[@]" \
        '*:RAR files:_files -g \*.rar\(-.\)' && return
    fi
  ;;
  rar)
    if (( CURRENT == 2 )); then
      _values 'rar command' \
	'a[add files to archive]' \
	'c[add archive comment]' \
	'cf[add files comment]' \
	'cw[write archive comment to file]' \
	'd[delete files from archive]' \
	'e[extract files to current directory]' \
	'f[freshen files in archive]' \
	'i[find string in archives]' \
	'k[lock archive]' \
	'l[list archive]' \
	'lt[list archive (technical format)]' \
	'lb[list archive (bare format)]' \
	'm[move to archive]' \
	'mf[move to archive (files only)]' \
	'p[print file to stdout]' \
	'r[repair archive]' \
	'rc[reconstruct missing volumes]' \
	'rr[add data recovery record]' \
	'rv[create recovery volumes]' \
	's[convert archive to or from SFX]' \
	't[test archive files]' \
	'u[update files in archive]' \
	'v[verbosely list archive]' \
	'vt[verbosely list archive (technical format)]' \
	'vb[verbosely list archive (bare format)]' \
	'x[extract files with full path]' && 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