zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Extend completion for mpc
@ 2014-01-10 20:53 Koen Wilde
  0 siblings, 0 replies; only message in thread
From: Koen Wilde @ 2014-01-10 20:53 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

`mpc search` allows for multiple types to be queried at once, as follows:

    mpc search <type> <query> [<type> <query>]...

This patch enables completion for subsequent types as well, instead of just for
the first one.
---
 Completion/Unix/Command/_mpc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_mpc b/Completion/Unix/Command/_mpc
index 1ff9ad9..e72feef 100644
--- a/Completion/Unix/Command/_mpc
+++ b/Completion/Unix/Command/_mpc
@@ -253,7 +253,7 @@ _mpc_search() {
   local list expl
   list=(album artist title track name genre date composer performer comment disc filename any)
 
-  if [[ $#words -eq 2 ]]; then
+  if ! (( $#words % 2 )); then
     _wanted list expl table compadd $expl -a list
   else
     _message "pattern"
-- 
1.8.5.2

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-10 20:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-10 20:53 [PATCH] Extend completion for mpc Koen Wilde

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).