summaryrefslogtreecommitdiff
path: root/etc/completions/_fdupes
blob: 32ce300e4ffc954f1faff00c23c0ec781a6364c5 (plain)
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
#compdef fdupes
## completion for fdupes v1.50-RP2, based on fdupes(1)
## Copyright © 2010 by Birte Friesel <derf@finalrewind.org>
## License: WTFPL <http://sam.zoy.org/wtfpl>:
##   0. You just DO WHAT THE FUCK YOU WANT TO.
##
## http://finalrewind.org/git/zsh/plain/etc/completions/_fdupes

typeset -a arguments
typeset -A argument_pairs argument_postfix
typeset arg

argument_pairs=(
	recurse       r
	recurse\\:    R
	symlinks      s
	hardlinks     H
	noempty       n
	omitfirst     f
	nohidden      A
	sameline      1
	size          S
	summarize     m
	quiet         q
	delete        d
	hardlink      L
	noprompt      N
	debug         D
	version       v
	help          h
)

argument_postfix=(
	recurse       '[Recurse into subdirectories]'
	recurse\\:    '[Recurse into subdirectories only after this option]'
	symlinks      '[Follow symlinked directorie]'
	hardlinks     '[Treat hardlinked files as duplicates]'
	noempty       '[Exclude zero-length files]'
	omitfirst     '[Omit first file in each set of showed matches]'
	nohidden      '[Exclude hidden files]'
	sameline      '[List each set of matches on a single line]'
	size          '[Show size of duplicate files]'
	summarize     '[Summarize duplicate files information]'
	quiet         '[Hide progress bar]'
	delete        '[Prompt user for files to preserve, deleting all others]'
	hardlink      '[Replace all duplicates with hardlinks to the first file]'
	noprompt      '[Preserve first file, delete all other duplicates of it]'
	debug         '[Show debug information]'
	version       '[Show version]'
	help          '[Show help]'
)

arguments=(
	'*:directory:_files -/'
)

for arg in ${(k)argument_pairs}; {
	arguments+='(--'${arg}')-'${argument_pairs[$arg]}${argument_postfix[$arg]}
	arguments+='(-'${${argument_pairs[$arg]}[1]}')--'${arg}${argument_postfix[$arg]}
}

_arguments -s ${arguments}