Rename _ssh_bindaddress to global _ip_addresses for reuse in other completions.

This commit is contained in:
Ville Skyttä 2011-06-02 10:49:06 +03:00
parent 5bb9343fba
commit 8f3777e278
2 changed files with 13 additions and 11 deletions

View File

@ -888,6 +888,17 @@ _configured_interfaces()
fi fi
} }
# Local IP addresses.
#
_ip_addresses()
{
COMPREPLY+=( $( compgen -W \
"$( PATH="$PATH:/sbin" ifconfig -a |
sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \
-ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \
-- "$cur" ) )
}
# This function completes on available kernels # This function completes on available kernels
# #
_kernel_versions() _kernel_versions()

View File

@ -2,15 +2,6 @@
have ssh || return have ssh || return
_ssh_bindaddress()
{
COMPREPLY+=( $( compgen -W \
"$( PATH="$PATH:/sbin" ifconfig -a | \
sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \
-ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \
-- "$cur" ) )
}
_ssh_ciphers() _ssh_ciphers()
{ {
COMPREPLY+=( $( compgen -W '3des-cbc aes128-cbc \ COMPREPLY+=( $( compgen -W '3des-cbc aes128-cbc \
@ -73,7 +64,7 @@ _ssh_suboption()
COMPREPLY=( $( compgen -W 'any inet inet6' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'any inet inet6' -- "$cur" ) )
;; ;;
BindAddress) BindAddress)
_ssh_bindaddress _ip_addresses
;; ;;
Cipher) Cipher)
COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$cur" ) )
@ -149,7 +140,7 @@ _ssh()
return 0 return 0
;; ;;
-b) -b)
_ssh_bindaddress _ip_addresses
return 0 return 0
;; ;;
-D|-e|-I|-L|-O|-p|-R|-W) -D|-e|-I|-L|-O|-p|-R|-W)