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

Guillaume Rousse guillomovitch at zarb.org
Tue May 5 20:49:36 UTC 2009


The following commit has been merged in the master branch:
commit 5decc1de0480cef1648a30864a3b894867fc5c97
Author: Guillaume Rousse <guillomovitch at zarb.org>
Date:   Sat May 2 17:23:21 2009 +0200

    standard completion scheme for ssh-copy-id

diff --git a/contrib/ssh b/contrib/ssh
index c6cedae..f30db98 100644
--- a/contrib/ssh
+++ b/contrib/ssh
@@ -179,16 +179,18 @@ _ssh_copy_id() {
 	prev=${COMP_WORDS[COMP_CWORD-1]}
 
 	case "$prev" in
-		-*i)
-		_filedir
-		;;
-	*)
-		_known_hosts -a
-
-		[ $COMP_CWORD -eq 1 ] || \
-			COMPREPLY=( "${COMPREPLY[@]}" $( compgen -- $cur ) )
+		-i)
+			_filedir
+			return 0
+			;;
 	esac
 
+	if [[ "$cur" == -* ]]; then
+		COMPREPLY=( $( compgen -W '-i' -- $cur ) )
+	else
+		_known_hosts -a
+	fi
+
 	return 0
 }
 complete -F _ssh_copy_id $filenames ssh-copy-id

-- 
bash-completion



More information about the Bash-completion-commits mailing list