Add lighty-*-mod completion.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 22 Sep 2012 19:10:08 +0300
changeset 553 50b46df6ca28
parent 552 1f489f80b389
child 554 495b0d0c1fed
Add lighty-*-mod completion.
.bash_completion
--- a/.bash_completion	Sat Sep 22 09:45:29 2012 +0300
+++ b/.bash_completion	Sat Sep 22 19:10:08 2012 +0300
@@ -155,3 +155,17 @@
 }
 complete -F _cygcheck cygcheck.exe cygcheck
 
+_lighty() {
+  local cur=${COMP_WORDS[COMP_CWORD]}
+  local mods=( /etc/lighttpd/conf-available/*.conf )
+  mods=( ${mods[@]##*/} )
+  mods=( ${mods[@]#??-} )
+  mods=( ${mods[@]%.conf} )
+
+  COMPREPLY=( $(compgen -W '${mods[@]}' -- $cur) )
+  return 0
+}
+
+complete -F _lighty lighty-disable-mod
+complete -F _lighty lighty-enable-mod
+