Split ifup and ifdown completions into contrib/ifupdown.

This commit is contained in:
Ville Skyttä 2010-06-09 22:53:43 +03:00
parent 887361302b
commit cdbfd8e224
4 changed files with 29 additions and 20 deletions

View File

@ -61,6 +61,7 @@ bash-completion (2.x)
* Split kill, look, and renice completions into contrib/util-linux. * Split kill, look, and renice completions into contrib/util-linux.
* Split killall, pkill, pgrep and related completions into contrib/procps. * Split killall, pkill, pgrep and related completions into contrib/procps.
* Split ipsec completion into contrib/ipsec. * Split ipsec completion into contrib/ipsec.
* Split ifup and ifdown completions into contrib/ifupdown.
* Do basic HTML file completion with Firefox and Chrome and friends, * Do basic HTML file completion with Firefox and Chrome and friends,
and Epiphany. and Epiphany.
* Do basic diff/patch completion with cdiff and kompare. * Do basic diff/patch completion with cdiff and kompare.

View File

@ -55,6 +55,7 @@ bashcomp_DATA = contrib/abook \
contrib/heimdal \ contrib/heimdal \
contrib/hping2 \ contrib/hping2 \
contrib/iconv \ contrib/iconv \
contrib/ifupdown \
contrib/imagemagick \ contrib/imagemagick \
contrib/info \ contrib/info \
contrib/iptables \ contrib/iptables \

View File

@ -1082,26 +1082,6 @@ _dvd_devices()
patch configure build install reinstall deinstall clean clean-depends \ patch configure build install reinstall deinstall clean clean-depends \
kernel buildworld' make kernel buildworld' make
# Red Hat & Debian GNU/Linux if{up,down} completion
#
[ $USERLAND = GNU ] && { have ifup || have ifdown; } &&
_ifupdown()
{
local cur
COMPREPLY=()
cur=`_get_cword`
if [ $COMP_CWORD -eq 1 ]; then
_configured_interfaces
COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
fi
return 0
} &&
complete -F _ifupdown ifup ifdown
[ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus
# This function provides simple user@host completion # This function provides simple user@host completion
# #
_user_at_host() { _user_at_host() {

27
contrib/ifupdown Normal file
View File

@ -0,0 +1,27 @@
# Red Hat & Debian GNU/Linux if{up,down} completion
#
[ $USERLAND = GNU ] && { have ifup || have ifdown; } &&
_ifupdown()
{
local cur
COMPREPLY=()
cur=`_get_cword`
if [ $COMP_CWORD -eq 1 ]; then
_configured_interfaces
COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
fi
return 0
} &&
complete -F _ifupdown ifup ifdown
[ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
# sh-indent-comment: t
# indent-tabs-mode: nil
# End:
# ex: ts=4 sw=4 et filetype=sh