# HG changeset patch # User Oleksandr Gavenko # Date 1348330208 -10800 # Node ID 50b46df6ca2806ca1ea0e1903c1854e038eeada8 # Parent 1f489f80b389d6148d12656fe1105c4963e2103a Add lighty-*-mod completion. diff -r 1f489f80b389 -r 50b46df6ca28 .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 +