diff options
author | Wayne Davison <wayned@users.sourceforge.net> | 2005-11-18 17:43:25 +0000 |
---|---|---|
committer | Wayne Davison <wayned@users.sourceforge.net> | 2005-11-18 17:43:25 +0000 |
commit | d8200a0b74dde5242a3bcbfc126ab4d5971ddbda (patch) | |
tree | 5c9e7234521357950f2493a6e92f4ecf0dccdca9 | |
parent | 210259093a5d1536ceeeff76a052ee99d249c7e1 (diff) | |
download | zsh-d8200a0b74dde5242a3bcbfc126ab4d5971ddbda.tar.gz zsh-d8200a0b74dde5242a3bcbfc126ab4d5971ddbda.tar.xz zsh-d8200a0b74dde5242a3bcbfc126ab4d5971ddbda.zip |
Make the new completion handle multile names per "Host" directive
and elide names that contain wildcards.
-rw-r--r-- | Completion/Unix/Command/_ssh | 11 |
1 files changed, 8 insertions, 3 deletions
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 |