[Bash-completion-commits] [SCM] bash-completion branch, master, updated. e308b07526eba5667f17ea04e4e57f38ca6edf9e
Ville Skyttä
ville.skytta at iki.fi
Thu Dec 24 14:04:51 UTC 2009
The following commit has been merged in the master branch:
commit b56e45eaac521d799171d96bfffe6c5f3087af53
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Thu Dec 24 15:52:05 2009 +0200
Eliminate some duplicate code.
diff --git a/contrib/ssh b/contrib/ssh
index 1016c16..714f9ff 100644
--- a/contrib/ssh
+++ b/contrib/ssh
@@ -3,6 +3,19 @@
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 at openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "$1" ) )
+}
+
_ssh_options()
{
type compopt &>/dev/null && compopt -o nospace
@@ -66,14 +79,10 @@ _ssh_suboption()
-- "$subval" ) )
;;
MACs)
- COMPREPLY=( $( compgen -W 'hmac-md5 hmac-sha1 umac-64 at openssh.com \
- hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "subval" ) )
+ _ssh_macs "$subval"
;;
Ciphers)
- COMPREPLY=( $( compgen -W '3des-cbc aes128-cbc aes192-cbc \
- aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 \
- arcfour256 arcfour blowfish-cbc cast128-cbc' \
- -- "$subval" ) )
+ _ssh_ciphers "$subval"
;;
esac
return 0
@@ -110,14 +119,11 @@ _ssh()
return 0
;;
-c)
- COMPREPLY=( $( compgen -W '3des-cbc aes128-cbc aes192-cbc \
- aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 \
- arcfour256 arcfour blowfish-cbc cast128-cbc' -- "$cur" ) )
+ _ssh_ciphers "$cur"
return 0
;;
-m)
- COMPREPLY=( $( compgen -W 'hmac-md5 hmac-sha1 umac-64 at openssh.com \
- hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "$cur" ) )
+ _ssh_macs "$cur"
return 0
;;
-l)
--
bash-completion
More information about the Bash-completion-commits
mailing list