]> Raphaƫl G. Git Repositories - youtubedl/blob - devscripts/zsh-completion.in
Record the explicit provenance of public domain status.
[youtubedl] / devscripts / zsh-completion.in
1 #compdef youtube-dl
2
3 __youtube_dl() {
4 local curcontext="$curcontext" fileopts diropts cur prev
5 typeset -A opt_args
6 fileopts="{{fileopts}}"
7 diropts="{{diropts}}"
8 cur=$words[CURRENT]
9 case $cur in
10 :)
11 _arguments '*: :(::ytfavorites ::ytrecommended ::ytsubscriptions ::ytwatchlater ::ythistory)'
12 ;;
13 *)
14 prev=$words[CURRENT-1]
15 if [[ ${prev} =~ ${fileopts} ]]; then
16 _path_files
17 elif [[ ${prev} =~ ${diropts} ]]; then
18 _path_files -/
19 elif [[ ${prev} == "--recode-video" ]]; then
20 _arguments '*: :(mp4 flv ogg webm mkv)'
21 else
22 _arguments '*: :({{flags}})'
23 fi
24 ;;
25 esac
26 }
27
28 __youtube_dl