Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 39F4F431FC3 for ; Mon, 1 Mar 2010 07:39:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.139 X-Spam-Level: X-Spam-Status: No, score=-1.139 tagged_above=-999 required=5 tests=[AWL=-0.029, BAYES_05=-1.11] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 94nOTcI0vkFM for ; Mon, 1 Mar 2010 07:39:18 -0800 (PST) Received: from homiemail-a17.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by olra.theworths.org (Postfix) with ESMTP id A32C4431FBD for ; Mon, 1 Mar 2010 07:39:18 -0800 (PST) Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch [129.132.133.204]) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTPA id E54BC7A8069; Mon, 1 Mar 2010 07:39:09 -0800 (PST) From: Sebastian Spaeth To: notmuch@notmuchmail.org Date: Mon, 1 Mar 2010 16:39:06 +0100 Message-Id: <1267457946-30347-1-git-send-email-Sebastian@SSpaeth.de> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <87r5o49kow.fsf@SSpaeth.de> References: <87r5o49kow.fsf@SSpaeth.de> Subject: [notmuch] [PATCH] notmuch-show: add tags to json output X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 15:39:19 -0000 The previous json patches forgot to add the notmuch tags to the json output. This is inconsistent to the text output so here they are. We just output a 'tags' field that sends a space delimited list of json-encoded notmuch tags. Signed-off-by: Sebastian Spaeth --- notmuch-show.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 1a1d601..0f10797 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -138,10 +138,11 @@ format_message_json (const void *ctx, notmuch_message_t *message, unused (int in { void *ctx_quote = talloc_new (ctx); - printf ("\"id\": %s, \"match\": %s, \"filename\": %s", + printf ("\"id\": %s, \"match\": %s, \"filename\": %s, \"tags\": %s", json_quote_str (ctx_quote, notmuch_message_get_message_id (message)), notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH) ? "true" : "false", - json_quote_str (ctx_quote, notmuch_message_get_filename (message))); + json_quote_str (ctx_quote, notmuch_message_get_filename (message)), + json_quote_str (ctx_quote, _get_tags_as_string (ctx_quote, message))); talloc_free (ctx_quote); } -- 1.6.3.3