aboutsummaryrefslogtreecommitdiff
path: root/devscripts/bash-completion.in
blob: bd10f63c2f2615168a482085ad156a9f4e330ddd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
__youtube-dl()
{
    local cur prev opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    opts="{{flags}}"
    keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater"

    if [[ ${cur} =~ : ]]; then
        COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) )
        return 0
    elif [[ ${cur} == * ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}

complete -F __youtube-dl youtube-dl