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 EE538431FBC for ; Tue, 23 Feb 2010 15:35:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.329 X-Spam-Level: X-Spam-Status: No, score=-2.329 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.211, BAYES_20=-0.74] 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 NouxVsTvrhd7; Tue, 23 Feb 2010 15:35:46 -0800 (PST) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 14C6E431FAE; Tue, 23 Feb 2010 15:35:46 -0800 (PST) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 3423425427B; Tue, 23 Feb 2010 15:35:44 -0800 (PST) From: Carl Worth To: Jameson Rollins , david@tethera.net, notmuch@notmuchmail.org In-Reply-To: <87wry33bxq.fsf@servo.finestructure.net> References: <1261114167-sup-8228@lisa> <1261141195-5469-1-git-send-email-david@tethera.net> <878wajwwth.fsf@yoom.home.cworth.org> <87wry33bxq.fsf@servo.finestructure.net> Date: Tue, 23 Feb 2010 15:35:43 -0800 Message-ID: <87635nwmnk.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: [notmuch] JSON output as default [was: Re: [PATCH] Add an "--output=(json|text|)" command-line option...] 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: Tue, 23 Feb 2010 23:35:47 -0000 --=-=-= On Tue, 23 Feb 2010 16:00:01 -0500, Jameson Rollins wrote: > Hey, Carl. I mentioned this is an email a while back > (id:87eil4ygar.fsf@servo.finestructure.net), but I want to bring it up > again now that you're looking at the JSON output stuff. I would like to > make the case for JSON being the one and only output format. Here's the > arguments: Oh, I'm definitely in favor of killing the %message{ format. As soon as we get the emacs and vi frontends switched to the json output, then that old thing can be eliminated. > * using only one output format would considerably reduce the code base > in notmuch, keeping things simpler and easier to maintain But I actually still want text-only output. It will be even less "parseable" than the current output, (no delimiters at all), but also have some niceties like thread indentation, etc. The idea there is to support direct, human-readable output for quick command-line use. (It also means that notmuch provides a much gentler introduction to people just experimenting with it). And I'm willing to keep the code base just a "little" bit complicated for that. > If we move to JSON output, it would be *so* sweet to provide means to > filter the output JSON fields. The "--output" flag could be used to > pick the desired output fields. For instance, the current "search" > output could be something like: I definitely want to enable the user to select which fields are printed. But I don't see how that depends on JSON output. In fact, for easy shell scripts, etc. I want to be able to do search that give me filenames, email addresses, etc. without any delimiters at all. I definitely want to be able to pipe single-field lists coming from notmuch to grep, xargs, shell for loops, etc. without having to decode JSON. So I'm still in favor of having a "plain text" output going forward, (and by default). -Carl --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFLhGZQ6JDdNq8qSWgRAiNHAKClF95oKYVmh79wQWP45dFb6rKEBQCeOJBv LbnWo/qmhBhQzjXjzwDLIso= =DUwJ -----END PGP SIGNATURE----- --=-=-=--