[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-290-g68f7fa1

Ville Skyttä ville.skytta at iki.fi
Wed May 11 21:29:25 UTC 2011


The following commit has been merged in the master branch:
commit 68f7fa16b0db6b744495e3fa70819e9ed90ca0bf
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Thu May 12 00:24:57 2011 +0300

    ssh, scp, sftp, ssh-copy-id: Use _parse_help/_parse_usage, add some option argument (non)completions.

diff --git a/completions/ssh b/completions/ssh
index f75056b..16654bc 100644
--- a/completions/ssh
+++ b/completions/ssh
@@ -152,6 +152,9 @@ _ssh()
             _ssh_bindaddress
             return 0
             ;;
+        -D|-e|-I|-L|-O|-p|-R|-W)
+            return 0
+            ;;
     esac
 
     if [[ "$cur" == -F* ]]; then
@@ -161,9 +164,7 @@ _ssh()
         COMPREPLY=( "${COMPREPLY[@]/#/-F}" )
         cur=-F$cur  # Restore cur
     elif [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-1 -2 -4 -6 -A -a -C -f -g -K -k -M \
-            -N -n -q -s -T -t -V -v -X -v -Y -y -b -b -c -D -e -F \
-            -i -L -l -m -O -o -p -R -S -w' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
     else
         # Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument
         set -- "${words[@]}"
@@ -202,7 +203,7 @@ _sftp()
     _ssh_suboption_check && return 0
 
     case $prev in
-        -b|-F|-P)
+        -b|-F|-i)
             _filedir
             return 0
             ;;
@@ -210,6 +211,13 @@ _sftp()
             _ssh_options
             return 0
             ;;
+        -c)
+            _ssh_ciphers
+            return 0
+            ;;
+        -B|-D|-P|-R|-S|-s)
+            return 0
+            ;;
     esac
 
     if [[ "$cur" == -F* ]]; then
@@ -219,8 +227,7 @@ _sftp()
         COMPREPLY=( "${COMPREPLY[@]/#/-F}" )
         cur=-F$cur  # Restore cur
     elif [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-1 -C -v -B -b -F -o -P -R -S -s' \
-            -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
     else
         # Search COMP_WORDS for '-F configfile' argument
         set -- "${words[@]}"
@@ -369,8 +376,8 @@ _scp()
 
         case $cur in
             -*)
-                COMPREPLY=( $( compgen -W '-1 -2 -4 -6 -B -C -c -F -i -l -o \
-                    -P -p -q -r -S -v' -- "$cur" ) )
+                COMPREPLY=( $( compgen -W '$( _parse_usage "${words[0]}" )' \
+                    -- "$cur" ) )
                 COMPREPLY=( "${COMPREPLY[@]/%/ }" )
                 return 0
                 ;;
@@ -404,7 +411,7 @@ _ssh_copy_id()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '-i' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
     else
         _known_hosts_real -a "$cur"
     fi

-- 
bash-completion



More information about the Bash-completion-commits mailing list