summarylogtreecommitdiffstats
path: root/bash_completion
blob: a733fea8e36a9e1ccb264e7af5f6546ad980a150 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# vi ft=sh
# bash completion for nginx configuration tools
_nginx_modsites()
{
       COMPREPLY=( $( compgen -W '$( command ls /etc/nginx/$1 2>/dev/null \
               | sed -e 's/[.]conf$//' )' -- $cur  ) )
}

_nginx-ensite()
{
       local cur

       COMPREPLY=()
       cur=${COMP_WORDS[COMP_CWORD]}

       _nginx_modsites sites-available

}
complete -F _nginx-ensite nginx-ensite

_nginx-dissite()
{
       local cur

       COMPREPLY=()
       cur=${COMP_WORDS[COMP_CWORD]}

       _nginx_modsites sites-enabled

}
complete -F _nginx-dissite nginx-dissite