aboutsummaryrefslogtreecommitdiffstats
path: root/devscripts
diff options
context:
space:
mode:
authorRogério Brito <rbrito@ime.usp.br>2013-12-05 01:41:08 -0200
committerRogério Brito <rbrito@ime.usp.br>2013-12-05 01:41:08 -0200
commitb238854ce845f3796daac74edab2e8a373e8ba1a (patch)
treec4a1b63f01141ac36dab2850e0bd11372da0e024 /devscripts
parent90cd207d52d77e075e62cc256cc39dceee05bbf3 (diff)
downloadyoutube-dl-b238854ce845f3796daac74edab2e8a373e8ba1a.zip
youtube-dl-b238854ce845f3796daac74edab2e8a373e8ba1a.tar.gz
youtube-dl-b238854ce845f3796daac74edab2e8a373e8ba1a.tar.bz2
Imported Upstream version 2013.12.04
Diffstat (limited to 'devscripts')
-rw-r--r--devscripts/bash-completion.in15
1 files changed, 13 insertions, 2 deletions
diff --git a/devscripts/bash-completion.in b/devscripts/bash-completion.in
index ce893fc..3af87a3 100644
--- a/devscripts/bash-completion.in
+++ b/devscripts/bash-completion.in
@@ -1,10 +1,21 @@
__youtube_dl()
{
- local cur prev opts
+ local cur prev opts fileopts diropts keywords
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="{{flags}}"
- keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater"
+ keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory"
+ fileopts="-a|--batch-file|--download-archive|--cookies"
+ diropts="--cache-dir"
+
+ if [[ ${prev} =~ ${fileopts} ]]; then
+ COMPREPLY=( $(compgen -f -- ${cur}) )
+ return 0
+ elif [[ ${prev} =~ ${diropts} ]]; then
+ COMPREPLY=( $(compgen -d -- ${cur}) )
+ return 0
+ fi
if [[ ${cur} =~ : ]]; then
COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) )