]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube-dl.bash-completion
Merge tag 'upstream/2014.06.07'
[youtubedl] / youtube-dl.bash-completion
1 __youtube_dl()
2 {
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="--help --version --update --ignore-errors --abort-on-error --dump-user-agent --user-agent --referer --add-header --list-extractors --extractor-descriptions --proxy --no-check-certificate --prefer-insecure --cache-dir --no-cache-dir --socket-timeout --bidi-workaround --default-search --ignore-config --encoding --playlist-start --playlist-end --match-title --reject-title --max-downloads --min-filesize --max-filesize --date --datebefore --dateafter --min-views --max-views --no-playlist --age-limit --download-archive --include-ads --youtube-include-dash-manifest --rate-limit --retries --buffer-size --no-resize-buffer --test --title --id --literal --auto-number --output --autonumber-size --restrict-filenames --batch-file --load-info --no-overwrites --continue --no-continue --cookies --no-part --no-mtime --write-description --write-info-json --write-annotations --write-thumbnail --quiet --no-warnings --simulate --skip-download --get-url --get-title --get-id --get-thumbnail --get-description --get-duration --get-filename --get-format --dump-json --newline --no-progress --console-title --verbose --dump-intermediate-pages --write-pages --youtube-print-sig-code --print-traffic --format --all-formats --prefer-free-formats --max-quality --list-formats --write-sub --write-auto-sub --all-subs --list-subs --sub-format --sub-lang --username --password --netrc --video-password --extract-audio --audio-format --audio-quality --recode-video --keep-video --no-post-overwrites --embed-subs --embed-thumbnail --add-metadata --xattrs --prefer-avconv --prefer-ffmpeg"
8 keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory"
9 fileopts="-a|--batch-file|--download-archive|--cookies|--load-info"
10 diropts="--cache-dir"
11
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
19
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
27 }
28
29 complete -F __youtube_dl youtube-dl