summaryrefslogtreecommitdiff
path: root/etc/completions/_fdupes
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-06-01 21:40:15 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-06-01 21:40:15 +0200
commitfd89a3dc84914636678d6864ae820fb2c841d373 (patch)
treecfc9a5730d07228669cfa21b36214ef0937a3961 /etc/completions/_fdupes
parentc75afa6736331f78d5f04d468689eec3728e22ec (diff)
Add completion for fdupes
Diffstat (limited to 'etc/completions/_fdupes')
-rw-r--r--etc/completions/_fdupes59
1 files changed, 59 insertions, 0 deletions
diff --git a/etc/completions/_fdupes b/etc/completions/_fdupes
new file mode 100644
index 0000000..49fe911
--- /dev/null
+++ b/etc/completions/_fdupes
@@ -0,0 +1,59 @@
+#compdef fdupes
+## completion for fdupes v1.50-RP2, based on fdupes(1)
+## Copyright © 2010 by Daniel Friesel <derf@derf.homelinux.org>
+## License: WTFPL <http://sam.zoy.org/wtfpl>
+
+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}