Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Extend completion for mpc



`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: pgpBpXDequ1Zz.pgp
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author