1 2 3 4 5 6 7 8 9 10 11 12 13 14
__youtube-dl() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" opts="{{flags}}" if [[ ${cur} == * ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi } complete -F __youtube-dl youtube-dl