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 30F1C429E36 for ; Fri, 28 Jan 2011 14:03:00 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.99 X-Spam-Level: X-Spam-Status: No, score=-0.99 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1, T_MIME_NO_TEXT=0.01] autolearn=disabled 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 D0FEOGBizDV4; Fri, 28 Jan 2011 14:02:59 -0800 (PST) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 95515429E2E; Fri, 28 Jan 2011 14:02:53 -0800 (PST) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 2BA692540E1; Sat, 29 Jan 2011 06:44:40 +1000 (EST) From: Carl Worth To: Mike Kelly , notmuch@notmuchmail.org Subject: Re: About the json output and the number of results shown. In-Reply-To: <1294871985-ner-781@everglades> References: <1294871985-ner-781@everglades> User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Sat, 29 Jan 2011 06:44:40 +1000 Message-ID: <87mxmkn4g7.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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: Fri, 28 Jan 2011 22:03:00 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Wed, 12 Jan 2011 22:39:45 +0000, Mike Kelly wrote: > For starters, if I'm simply trying to retrieve a single message, the > interface is rather awkard. I seem to need to do something like: >=20 > my $json =3D `notmuch show --format=3Djson id:$message_id`; > my $parsed_json =3D decode_json($json); > my $message =3D $parsed_json->[0][0][0]; That does seem fairly awkward, yes. Do you have a suggestion for how you'd like the output to be structured instead? > And, when I'm doing my search earlier to even find those message ids, I > need to do a check to `notmuch count` first to see if I'll even get any > results, because the 0 result case is not valid JSON. Yikes! That's a bug in notmuch that we should get fixed rather than you just working around it. I just started adding a test for this case. Currently: notmuch search --format=3Djson "string that matches nothing" returns nothing. Presumably, this should return just an empty json array instead, (that is, "[]")? =2DCarl =2D-=20 carl.d.worth@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFNQyq46JDdNq8qSWgRAly6AJ9QjEtHZevh+qJHcFuTtWWZix1ZrwCeLP7t 12veyy5EkXjDbL0H7aNztI8= =riPt -----END PGP SIGNATURE----- --=-=-=--