Eliminate some duplicate code.
This commit is contained in:
parent
92e7b73564
commit
b56e45eaac
28
contrib/ssh
28
contrib/ssh
@ -3,6 +3,19 @@
|
|||||||
have ssh &&
|
have ssh &&
|
||||||
{
|
{
|
||||||
|
|
||||||
|
_ssh_ciphers()
|
||||||
|
{
|
||||||
|
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W '3des-cbc aes128-cbc \
|
||||||
|
aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 \
|
||||||
|
arcfour256 arcfour blowfish-cbc cast128-cbc' -- "$1" ) )
|
||||||
|
}
|
||||||
|
|
||||||
|
_ssh_macs()
|
||||||
|
{
|
||||||
|
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W 'hmac-md5 hmac-sha1 \
|
||||||
|
umac-64@openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "$1" ) )
|
||||||
|
}
|
||||||
|
|
||||||
_ssh_options()
|
_ssh_options()
|
||||||
{
|
{
|
||||||
type compopt &>/dev/null && compopt -o nospace
|
type compopt &>/dev/null && compopt -o nospace
|
||||||
@ -66,14 +79,10 @@ _ssh_suboption()
|
|||||||
-- "$subval" ) )
|
-- "$subval" ) )
|
||||||
;;
|
;;
|
||||||
MACs)
|
MACs)
|
||||||
COMPREPLY=( $( compgen -W 'hmac-md5 hmac-sha1 umac-64@openssh.com \
|
_ssh_macs "$subval"
|
||||||
hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "subval" ) )
|
|
||||||
;;
|
;;
|
||||||
Ciphers)
|
Ciphers)
|
||||||
COMPREPLY=( $( compgen -W '3des-cbc aes128-cbc aes192-cbc \
|
_ssh_ciphers "$subval"
|
||||||
aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 \
|
|
||||||
arcfour256 arcfour blowfish-cbc cast128-cbc' \
|
|
||||||
-- "$subval" ) )
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
return 0
|
return 0
|
||||||
@ -110,14 +119,11 @@ _ssh()
|
|||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
-c)
|
-c)
|
||||||
COMPREPLY=( $( compgen -W '3des-cbc aes128-cbc aes192-cbc \
|
_ssh_ciphers "$cur"
|
||||||
aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 \
|
|
||||||
arcfour256 arcfour blowfish-cbc cast128-cbc' -- "$cur" ) )
|
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
-m)
|
-m)
|
||||||
COMPREPLY=( $( compgen -W 'hmac-md5 hmac-sha1 umac-64@openssh.com \
|
_ssh_macs "$cur"
|
||||||
hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "$cur" ) )
|
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
-l)
|
-l)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user