From d8200a0b74dde5242a3bcbfc126ab4d5971ddbda Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 18 Nov 2005 17:43:25 +0000 Subject: Make the new completion handle multile names per "Host" directive and elide names that contain wildcards. --- Completion/Unix/Command/_ssh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command/_ssh') diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 0f2cb1dd5..bf695c4e2 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -320,10 +320,15 @@ _ssh_hosts () { ${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@" fi if [[ -r "$HOME/.ssh/config" ]]; then - local IFS=$'\t ' key host - while read key host; do + local IFS=$'\t ' key hosts host + while read key hosts; do if [[ "$key" == (#i)host ]]; then - config_hosts+=("$host") + for host in ${(z)hosts}; do + case $host in + (*[*?]*) ;; + (*) config_hosts+=("$host") ;; + esac + done fi done < "$HOME/.ssh/config" if (( ${#config_hosts} )); then -- cgit 1.4.1