[Bash-completion-commits] [SCM] bash-completion branch, master, updated. e308b07526eba5667f17ea04e4e57f38ca6edf9e

Ville Skyttä ville.skytta at iki.fi
Thu Dec 24 14:04:59 UTC 2009


The following commit has been merged in the master branch:
commit 7c4de4a3cadee867793699a458f6a30a1dac73d4
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Thu Dec 24 15:57:43 2009 +0200

    Use the usual (local) $prev and $cur in _ssh_suboption.

diff --git a/contrib/ssh b/contrib/ssh
index 714f9ff..10c3efb 100644
--- a/contrib/ssh
+++ b/contrib/ssh
@@ -7,13 +7,14 @@ _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" ) )
+        arcfour256 arcfour blowfish-cbc cast128-cbc' -- "$cur" ) )
 }
 
 _ssh_macs()
 {
     COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W 'hmac-md5 hmac-sha1 \
-        umac-64 at openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "$1" ) )
+        umac-64 at openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96' \
+        -- "$cur" ) )
 }
 
 _ssh_options()
@@ -45,9 +46,9 @@ _ssh_options()
 _ssh_suboption()
 {
     # Split into subopt and subval
-    local subopt=${1%%=*} subval=${1#*=}
+    local prev=${1%%=*} cur=${1#*=}
 
-    case "$subopt" in
+    case "$prev" in
         BatchMode|ChallengeResponseAuthentication|CheckHostIP|\
         ClearAllForwardings|Compression|ExitOnForwardFailure|ForwardAgent|\
         ForwardX11|ForwardX11Trusted|GatewayPorts|GSSAPIAuthentication|\
@@ -58,31 +59,30 @@ _ssh_suboption()
         PubkeyAuthentication|RhostsRSAAuthentication|RSAAuthentication|\
         StrictHostKeyChecking|TCPKeepAlive|UsePrivilegedPort|\
         VerifyHostKeyDNS|VisualHostKey)
-            COMPREPLY=( $( compgen -W 'yes no' -- "$subval") )
+            COMPREPLY=( $( compgen -W 'yes no' -- "$cur") )
             ;;
         AddressFamily)
-            COMPREPLY=( $( compgen -W 'any inet inet6' -- "$subval" ) )
+            COMPREPLY=( $( compgen -W 'any inet inet6' -- "$cur" ) )
             ;;
         Cipher)
-            COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$subval" ) )
+            COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$cur" ) )
             ;;
         Protocol)
-            COMPREPLY=( $( compgen -W '1 2 1,2 2,1' -- "$subval" ) )
+            COMPREPLY=( $( compgen -W '1 2 1,2 2,1' -- "$cur" ) )
             ;;
         Tunnel)
             COMPREPLY=( $( compgen -W 'yes no point-to-point ethernet' \
-                    -- "$subval" ) )
+                    -- "$cur" ) )
             ;;
         PreferredAuthentications)
             COMPREPLY=( $( compgen -W 'gssapi-with-mic host-based \
-                    publickey keyboard-interactive password' \
-                    -- "$subval" ) )
+                    publickey keyboard-interactive password' -- "$cur" ) )
             ;;
         MACs)
-            _ssh_macs "$subval"
+            _ssh_macs
             ;;
         Ciphers)
-            _ssh_ciphers "$subval"
+            _ssh_ciphers
             ;;
     esac
     return 0
@@ -119,11 +119,11 @@ _ssh()
             return 0
             ;;
         -c)
-            _ssh_ciphers "$cur"
+            _ssh_ciphers
             return 0
             ;;
         -m)
-            _ssh_macs "$cur"
+            _ssh_macs
             return 0
             ;;
         -l)

-- 
bash-completion



More information about the Bash-completion-commits mailing list