summaryrefslogtreecommitdiff
path: root/etc/completions/_youtube-dl
blob: a9c2cbbc399127567cc5f63c3a2e15885c9b79f7 (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
63
64
65
66
67
68
69
70
#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>:
##   0. You just DO WHAT THE FUCK YOU WANT TO.
##
## http://derf.homelinux.org/git/zsh/plain/etc/completions/_youtube-dl

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}