summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-06-01 20:22:47 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-06-01 20:22:47 +0200
commitc75afa6736331f78d5f04d468689eec3728e22ec (patch)
tree8154f06f260558dc023e8edfaeb53d7460c33103 /etc
parent08537d30ab636f3e8502d1ae7e0b37cbcb1f7a1f (diff)
Add completion for youtube-dl
Diffstat (limited to 'etc')
-rw-r--r--etc/completions/_youtube-dl67
1 files changed, 67 insertions, 0 deletions
diff --git a/etc/completions/_youtube-dl b/etc/completions/_youtube-dl
new file mode 100644
index 0000000..c0daef2
--- /dev/null
+++ b/etc/completions/_youtube-dl
@@ -0,0 +1,67 @@
+#compdef youtube-dl
+## completion for youtube-dl v2010.04.04, based on youtube-dl(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=(
+ help h
+ version v
+ ignore-errors i
+ rate-limit r
+ username u
+ password p
+ netrc n
+ format f
+ best-quality b
+ mobile-version m
+ high-def d
+ quiet q
+ simulate s
+ get-url g
+ get-title e
+ title t
+ literal l
+ output o
+ batch-file a
+ no-overwrites w
+ continue c
+)
+
+argument_postfix=(
+ help '[Show help]'
+ version '[Show version]'
+ ignore-errors '[Ignore errors when downloading]'
+ rate-limit '[Limit download rate]:bandwidth limit'
+ username '[Specify youtube username]:username'
+ password '[Specify youtube password]:password'
+ netrc '[Load authentication data from .netrc]'
+ format '[Specify video quality]:video format'
+ best-quality '[Download the best available quality]'
+ mobile-version '[Download mobile version of the video]'
+ high-def '[Download video in HD quality]'
+ quiet '[Quiet mode]'
+ simulate '[Do not actually download videos]'
+ get-url '[Print actual video url]'
+ get-title '[Print video title]'
+ title '[Put video title into the filename]'
+ literal '[Put literal video title into the filename]'
+ output '[Specify filename template]:template'
+ batch-file '[Download videos specified in file]:file:_files'
+ no-overwrites '[Do not overwrite existing files]'
+ continue '[Resume partial downloads]'
+)
+
+arguments=(
+ '*:youtube link'
+)
+
+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}