From cd3cae9285ba18ff5159f0d407fc681acf61dbf5 Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Sat, 16 Aug 2014 14:48:17 +0300 Subject: [PATCH] shell-completion: zsh: Don't use multiple option sets for one command The options were divided to multiple sets to prevent (or at least try to prevent) completing e.g. --server after -s was already given. This, however, caused problems, because after the user had written "pactl --server foo", further completions stopped to work. The "server" option set didn't contain any other options, so once Zsh detected that the "server" option set was in use, it thought that no other options were valid. The special casing for "-s", "-n", "--server" and "--client-*" at the end of _pactl_completion() was probably an attempt to deal with this problem. Those special cases are unnecessary now that the option specification given to _arguments is more correct. --- shell-completion/zsh/_pulseaudio | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/shell-completion/zsh/_pulseaudio b/shell-completion/zsh/_pulseaudio index d58ab479c..b993e85de 100644 --- a/shell-completion/zsh/_pulseaudio +++ b/shell-completion/zsh/_pulseaudio @@ -276,14 +276,11 @@ _pactl_completion() { ) _arguments -C \ - - '(help)' \ - {-h,--help}'[display help and exit]' \ + {-h,--help}'[display help and exit]' \ '--version[show version and exit]' \ - - '(server)' \ - {-s,--server}'[name of server to connect to]:host:_hosts' \ - - '(name)' \ - {-n,--client-name}'[client name to use]:name' \ - '::pactl commands:_pactl_command' \ + {-s,--server}'[name of server to connect to]:host:_hosts' \ + {-n,--client-name}'[client name to use]:name' \ + '::pactl command:_pactl_command' case $words[$((CURRENT - 1))] in list) _describe 'pactl list commands' _pactl_list_commands;; @@ -307,8 +304,6 @@ _pactl_completion() { suspend-*) compadd true false;; list) compadd short;; move-*) _devices;; - '-s' | '-n') _pactl_command;; - --server | --client-*) _pactl_command;; esac } @@ -375,8 +370,7 @@ _pacmd_completion() { } _arguments -C \ - - '(help)' \ - {-h,--help}'[display help and exit]' \ + {-h,--help}'[display help and exit]' \ '--version[show version and exit]' \ '::pacmd commands:_pacmd_command' \