--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id E91AF429E51\r
+ for <notmuch@notmuchmail.org>; Mon, 1 Apr 2013 02:44:16 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Zb95TUGWDf16 for <notmuch@notmuchmail.org>;\r
+ Mon, 1 Apr 2013 02:44:16 -0700 (PDT)\r
+Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com\r
+ [209.85.217.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id BD989429E53\r
+ for <notmuch@notmuchmail.org>; Mon, 1 Apr 2013 02:44:12 -0700 (PDT)\r
+Received: by mail-lb0-f169.google.com with SMTP id p11so1782989lbi.28\r
+ for <notmuch@notmuchmail.org>; Mon, 01 Apr 2013 02:44:11 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+ :references:in-reply-to:references:x-gm-message-state;\r
+ bh=tCTkPbzXJfpliooaNzv9wxgSS4RuWr2VkhCzkeR72/U=;\r
+ b=NMiA8r2s/c6qlhrAIFy+d0CNU1qFle8nlyztK3nDzgg6ST0U1WOpgfW0kBNhPhYm+t\r
+ tW0FiigvPFoclrCHEDINBjiBJyt2+HkZNq3wDKYu7NSDNZ+jhdY1DKb4ygM9Uuni5S8J\r
+ DplVO5JfKB98T+Vu51jmagR2maQlYJ4/1ISR9695r0jT8BxQ6Otp52DNgiti/E/tEibG\r
+ Yi33SsqZvpgPBhbNwv9vOPWsSp8du/Urxo8yhQEQYfw8rI7C8Ku9Z7Sk1jltwhny86ui\r
+ 8VKPnFg/ZmUHXawrKCUh4p0BimmZ/h21IFBIUdNKPznXnwyibSPlIHtd7/qbIq9Bg6zW\r
+ XwUg==\r
+X-Received: by 10.152.104.199 with SMTP id gg7mr5357501lab.14.1364809451289;\r
+ Mon, 01 Apr 2013 02:44:11 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
+ [80.223.81.27])\r
+ by mx.google.com with ESMTPS id e9sm5204773lbz.1.2013.04.01.02.44.09\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Mon, 01 Apr 2013 02:44:10 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] nmbug-status: add support for querying the search views\r
+Date: Mon, 1 Apr 2013 12:44:01 +0300\r
+Message-Id:\r
+ <9bb1be6703c10474d96ccb0f07292e55659a2436.1364809172.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1364809172.git.jani@nikula.org>\r
+References: <cover.1364809172.git.jani@nikula.org>\r
+In-Reply-To: <cover.1364809172.git.jani@nikula.org>\r
+References: <cover.1364809172.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQlE6f5QJIbZG/ZdaWIVM9OwUsxgHMIEMG6jfjNcec5RdQwY9q7VEgp7gubjb/5WAPafWDk6\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 01 Apr 2013 09:44:17 -0000\r
+\r
+Make it easy for scripts to read the views and corresponding searches.\r
+---\r
+ devel/nmbug/nmbug-status | 16 ++++++++++++++--\r
+ 1 file changed, 14 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
+index 0283013..d83ca2d 100755\r
+--- a/devel/nmbug/nmbug-status\r
++++ b/devel/nmbug/nmbug-status\r
+@@ -13,6 +13,7 @@ import urllib\r
+ import json\r
+ import argparse\r
+ import os\r
++import sys\r
+ import subprocess\r
+ \r
+ # parse command line arguments\r
+@@ -20,9 +21,10 @@ import subprocess\r
+ parser = argparse.ArgumentParser()\r
+ parser.add_argument('--text', help='output plain text format',\r
+ action='store_true')\r
+-\r
+ parser.add_argument('--config', help='load config from given file')\r
+-\r
++parser.add_argument('--list-views', help='list views',\r
++ action='store_true')\r
++parser.add_argument('--get-query', help='get query for view')\r
+ \r
+ args = parser.parse_args()\r
+ \r
+@@ -38,6 +40,16 @@ else:\r
+ \r
+ config = json.load(fp)\r
+ \r
++if args.list_views:\r
++ for view in config['views']:\r
++ print view['title']\r
++ sys.exit(0)\r
++elif args.get_query != None:\r
++ for view in config['views']:\r
++ if args.get_query == view['title']:\r
++ print ' and '.join(view['query'])\r
++ sys.exit(0)\r
++\r
+ if args.text:\r
+ output_format = 'text'\r
+ else:\r
+-- \r
+1.7.10.4\r
+\r