summaryrefslogtreecommitdiffstats
path: root/completions/apache2ctl
blob: 08077888c999ed21009e6ef6e04cddb308b4e37b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# apache2ctl(1) completion                                 -*- shell-script -*-

_comp_cmd_apache2ctl()
{
    local cur prev words cword comp_args
    _comp_initialize -- "$@" || return

    local APWORDS
    APWORDS=$("$1" 2>&1 >/dev/null | _comp_awk 'NR<2 { print $3; exit }' |
        tr "|" " ")

    _comp_compgen -- -W "$APWORDS"
} &&
    complete -F _comp_cmd_apache2ctl apache2ctl

# ex: filetype=sh