Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: nicolas.pouillard@gmail.com (Nicolas Pouillard)
Subject: [sup-talk] [PATCH] Add a --query option to sup-tweak-labels.
Date: Fri, 14 Nov 2008 13:29:25 +0100	[thread overview]
Message-ID: <1226665765-32595-1-git-send-email-nicolas.pouillard@gmail.com> (raw)

---
 bin/sup-tweak-labels |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/bin/sup-tweak-labels b/bin/sup-tweak-labels
index 21e766c..4d1313e 100644
--- a/bin/sup-tweak-labels
+++ b/bin/sup-tweak-labels
@@ -39,6 +39,7 @@ Options:
 EOS
   opt :add, "One or more labels (comma-separated) to add to every message from the specified sources", :type => String
   opt :remove, "One or more labels (comma-separated) to remove from every message from the specified sources, if those labels are present", :type => String
+  opt :query, "A Sup search query", :type => String
 
   text <<EOS
 
@@ -76,6 +77,10 @@ begin
     ## query to only messages with those labels
     query += " +(" + remove_labels.map { |l| "label:#{l}" }.join(" ") + ")"
   end
+  query += ' ' + opts[:query] if opts[:query]
+
+  qobj, opts = Redwood::Index.parse_user_query_string query
+  query = Redwood::Index.build_query opts.merge(:qobj => qobj)
 
   results = index.ferret.search query, :limit => :all
   num_total = results.total_hits
-- 
1.5.5.rc3



             reply	other threads:[~2008-11-14 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14 12:29 Nicolas Pouillard [this message]
2008-11-20 15:15 ` William Morgan

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=1226665765-32595-1-git-send-email-nicolas.pouillard@gmail.com \
    --to=nicolas.pouillard@gmail.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox