]> Raphaƫl G. Git Repositories - youtubedl/blob - devscripts/bash-completion.in
bd10f63c2f2615168a482085ad156a9f4e330ddd
[youtubedl] / devscripts / bash-completion.in
1 __youtube-dl()
2 {
3 local cur prev opts
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 opts="{{flags}}"
7 keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater"
8
9 if [[ ${cur} =~ : ]]; then
10 COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) )
11 return 0
12 elif [[ ${cur} == * ]] ; then
13 COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
14 return 0
15 fi
16 }
17
18 complete -F __youtube-dl youtube-dl