[pulseaudio-discuss] [PATCH 2/6] shell-completion: zsh: Support also --server in remote detection

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Sat Aug 16 04:48:15 PDT 2014


_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.
---
 shell-completion/pulseaudio-zsh-completion.zsh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/shell-completion/pulseaudio-zsh-completion.zsh b/shell-completion/pulseaudio-zsh-completion.zsh
index 243c1b4..6ff8ec1 100644
--- a/shell-completion/pulseaudio-zsh-completion.zsh
+++ b/shell-completion/pulseaudio-zsh-completion.zsh
@@ -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
 }
-- 
1.9.3



More information about the pulseaudio-discuss mailing list