shell-completion: zsh: Rework pactl completion
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Sat, 18 Oct 2014 18:10:41 +0000 (21:10 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Sun, 26 Oct 2014 19:00:26 +0000 (21:00 +0200)
commiteaa80baea94b205658e666e5e1962604d5809f09
tree316a564695d2e05b0acb530e0d1f834253258dec
parent414646769d68285c6db2fa276de07e426f227dcf
shell-completion: zsh: Rework pactl completion

So far the command name has been figured out by looking one or two
items back in the $words array, but I needed a way to figure out the
command given an arbitrary number of parameters. I was implementing
a command for removing devices from the device-manager database, and
the command would take a list of devices. Since the number of devices
that need to be completed can be arbitrarily large, the previous "look
one or two words back" approach didn't work.

This new approach is more verbose, but I think it's also easier to
follow. There's some duplication that would be easy to avoid by
merging some of the commands, but I decided to not do that, to make
it more obvious what the code does.
shell-completion/zsh/_pulseaudio