]> jfr.im git - yt-dlp.git/blob - devscripts/bash-completion.in
Merge pull request #1620 from jaimeMF/console_script
[yt-dlp.git] / 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