shell-completion: zsh: Support also --server in remote detection

_set_remote() is supposed to find out if a remote server has been
specified on the command line, but previously it only checked for -s
and ignored --server, causing the completion code to connect to the
local server instead when it should have connected to the remote
server to get the data for the completions.
This commit is contained in:
Tanu Kaskinen 2014-08-16 14:48:15 +03:00
parent 09e9d13e2d
commit 1f9d4cbe93

View file

@ -2,9 +2,11 @@
_set_remote() {
for (( i = 0; i < ${#words[@]}; i++ )) do
if [[ ${words[$i]} == -s ]]; then
if [[ ${words[$i]} == -s || ${words[$i]} == --server ]]; then
remote="-s ${words[$i+1]}"
break;
elif [[ ${words[$i]} == --server=* ]]; then
remote=${words[$i]}
fi
done
}