From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A4A77431FBF; Fri, 25 Dec 2009 13:33:13 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 bkPIa2Zr9bO2; Fri, 25 Dec 2009 13:33:13 -0800 (PST) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id CDF18431FBC; Fri, 25 Dec 2009 13:33:12 -0800 (PST) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 67751254307; Tue, 22 Dec 2009 21:58:53 -0800 (PST) From: Carl Worth To: David Bremner , notmuch@notmuchmail.org In-Reply-To: <871virsstp.fsf@pivot.cs.unb.ca> References: <1261114167-sup-8228@lisa> <1261141195-5469-1-git-send-email-david@tethera.net> <87iqc4yyo8.fsf@yoom.home.cworth.org> <871virsstp.fsf@pivot.cs.unb.ca> Date: Tue, 22 Dec 2009 21:58:52 -0800 Message-ID: <87d426nsdf.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: [PATCH] Add an "--output=(json|text|)" command-line option to both notmuch-search and notmuch-show. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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, 25 Dec 2009 21:33:13 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Fri, 18 Dec 2009 20:36:34 -0400, David Bremner wrote: > It's a detail, but could you choose two names that are not substrings of > each other? Eventually we do want tab completion on the command line to > work :). Yes, that's a good point. > Also, "search --for tags foo" suggests to me that > searching for tags matching foo. What about using --output for that? OK. "--output" sounds good to me here. > One thing that is not completely clear to me at this point is what the > difference is between=20 >=20 > notmuch search --for messages search-terms >=20 > and=20 >=20 > notmuch show search-terms So, "notmuch show " is clear enough---it works as it does today. The new command, ("notmuch search --output=3Dmessages"), would be quite different. It would have single-line output for each message, (as "notmuch search" has single line-output already, but for threads by default). You can see behavior like this in the "notmuch search-messages" command for which I sent a patch a while ago, (but have never merged). The idea is that "notmuch search" would always give single-line output suitable for various kinds of processing. For example. How much mail have I sent? notmuch search --output=3Dmessages tag:sent | wc -l That's something you can't do with a thread-based search, (and it's not convenient to get a robust result from "notmuch show"). Once this is combined with a new --format to select what gets printed, I can imagine a lot of useful things, like collecting email addresses: notmuch search --output=3Dmessages --format=3D"${FROM}" to:cworth@cworth.o= rg or whatever. I can imagine a lot of different queries I'd like to be able to make of my mail store with things like this. =2DCarl --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iD8DBQFLMbGd6JDdNq8qSWgRAjB7AKCgsrVNgTYFswiSJXY3i/w7dOUAQgCgoAKC O/JDJ9YCvzdygtxPMOjeFpY= =9WWi -----END PGP SIGNATURE----- --=-=-=--