PageRenderTime 154ms CodeModel.GetById 152ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion_lib/complete/ifup

http://github.com/brinkman83/bashrc
#! | 20 lines | 13 code | 7 blank | 0 comment | 0 complexity | 011c4e9f178b3f60021f8c49ede9152d MD5 | raw file
 1# RedHat & Debian GNU/Linux if{up,down} completion
 2
 3
 4comp_include _get_cword _configured_interfaces
 5
 6
 7_ifup()
 8{
 9    local cur
10
11    COMPREPLY=()
12    cur=`_get_cword`
13
14    if [ $COMP_CWORD -eq 1 ]; then
15	_configured_interfaces
16	COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
17    fi
18
19    return 0
20}