summaryrefslogtreecommitdiff
path: root/shell-completion
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-08-16 14:48:17 +0300
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>2014-08-17 09:26:55 +0300
commitcd3cae9285ba18ff5159f0d407fc681acf61dbf5 (patch)
tree732cb4583990f0f2504d0e2ee94255747052815b /shell-completion
parent74c724db05f278650bff95d9a937c687c8e25373 (diff)
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.
Diffstat (limited to 'shell-completion')
-rw-r--r--shell-completion/zsh/_pulseaudio16
1 files 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' \