zsh-workers
 help / color / mirror / code / Atom feed
From: Koen Wilde <koen@chillheid.nl>
To: zsh-workers@zsh.org
Subject: [PATCH] Extend completion for mpc
Date: Fri, 10 Jan 2014 21:53:57 +0100	[thread overview]
Message-ID: <20140110205357.GC918@hugin.chillheid.nl> (raw)

[-- 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 --]

                 reply	other threads:[~2014-01-10 20:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140110205357.GC918@hugin.chillheid.nl \
    --to=koen@chillheid.nl \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).