Merge pull request #1350 from Jaiz909/description-keyerror-fix
[youtube-dl] / 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