summaryrefslogtreecommitdiff
path: root/completions/ifup
blob: fcd349941e999d4c7e179402596293ec3d670eb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Red Hat & Debian GNU/Linux if{up,down} completion        -*- shell-script -*-

_userland GNU || return 1

_ifupdown()
{
    local cur prev words cword
    _init_completion || return

    if [[ $cword -eq 1 ]]; then
        _configured_interfaces
        COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
    fi

    return 0
} &&
complete -F _ifupdown ifup ifdown ifstatus

# ex: ts=4 sw=4 et filetype=sh