[ie/youtube] Fix initial player response usage (Bugfix for 8b8b442cb005a8d85315f30161...
[yt-dlp3.git] / devscripts / bash-completion.in
blob21f52798ed203d94918da08c0899c8728e8b6192
1 __yt_dlp()
3     local cur prev opts fileopts diropts keywords
4     COMPREPLY=()
5     cur="${COMP_WORDS[COMP_CWORD]}"
6     prev="${COMP_WORDS[COMP_CWORD-1]}"
7     opts="{{flags}}"
8     keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory"
9     fileopts="-a|--batch-file|--download-archive|--cookies|--load-info"
10     diropts="--cache-dir"
12     if [[ ${prev} =~ ${fileopts} ]]; then
13         COMPREPLY=( $(compgen -f -- ${cur}) )
14         return 0
15     elif [[ ${prev} =~ ${diropts} ]]; then
16         COMPREPLY=( $(compgen -d -- ${cur}) )
17         return 0
18     fi
20     if [[ ${cur} =~ : ]]; then
21         COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) )
22         return 0
23     elif [[ ${cur} == * ]] ; then
24         COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
25         return 0
26     fi
29 complete -F __yt_dlp yt-dlp