aboutsummaryrefslogtreecommitdiff
path: root/devscripts/bash_completion.template
diff options
context:
space:
mode:
authorgcmalloc <gcmalloc@gmail.com>2012-12-07 21:38:45 +0100
committergcmalloc <gcmalloc@gmail.com>2012-12-07 21:38:45 +0100
commitbdff345529dee85e2c2bc9f142b1df17e4ee266b (patch)
treee4b4e9092b5e99e0944579e7e8eb7e2287f5f283 /devscripts/bash_completion.template
parent23109d6a9c7d8f2569a9adba517e90767e201bf4 (diff)
downloadyoutube-dl-bdff345529dee85e2c2bc9f142b1df17e4ee266b.tar.xz
adding a proper bash-completion generation
Diffstat (limited to 'devscripts/bash_completion.template')
-rw-r--r--devscripts/bash_completion.template14
1 files changed, 14 insertions, 0 deletions
diff --git a/devscripts/bash_completion.template b/devscripts/bash_completion.template
new file mode 100644
index 000000000..3b99a9614
--- /dev/null
+++ b/devscripts/bash_completion.template
@@ -0,0 +1,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