1 Return-Path: <francois.gannaz@free.fr>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 2D18740D157
\r
6 for <notmuch@notmuchmail.org>; Fri, 29 Oct 2010 01:42:54 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id lpbS9SLpt8-b for <notmuch@notmuchmail.org>;
\r
17 Fri, 29 Oct 2010 01:42:43 -0700 (PDT)
\r
18 Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2])
\r
19 by olra.theworths.org (Postfix) with ESMTP id B16FC40D152
\r
20 for <notmuch@notmuchmail.org>; Fri, 29 Oct 2010 01:42:42 -0700 (PDT)
\r
21 Received: from coriolan (unknown [88.172.133.112])
\r
22 by smtp2-g21.free.fr (Postfix) with ESMTP id 9854F4B005A
\r
23 for <notmuch@notmuchmail.org>; Fri, 29 Oct 2010 10:42:36 +0200 (CEST)
\r
24 Date: Fri, 29 Oct 2010 10:42:12 +0200
\r
25 From: =?UTF-8?B?RnJhbsOnb2lz?= Gannaz <francois.gannaz@free.fr>
\r
26 To: notmuch@notmuchmail.org
\r
27 Subject: Re: Notmuch scripters rejoice! New "notmuch search --output=(...)"
\r
28 Message-ID: <20101029104212.73d9cac8@coriolan>
\r
29 In-Reply-To: <8762wmglxe.fsf@yoom.home.cworth.org>
\r
30 References: <8762wmglxe.fsf@yoom.home.cworth.org>
\r
31 X-Mailer: Claws Mail 3.7.6cvs12 (GTK+ 2.20.1; x86_64-pc-linux-gnu)
\r
33 Content-Type: text/plain; charset=UTF-8
\r
34 Content-Transfer-Encoding: quoted-printable
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.13
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Fri, 29 Oct 2010 08:42:54 -0000
\r
49 On 2010-10-28, Carl Worth <cworth@cworth.org> wrote:
\r
50 > I just added a new feature to notmuch that I've been wanting for a very
\r
51 > long time. It's a new option to "notmuch search" as follows:
\r
53 > --output=3D(summary|threads|messages|files|tags)
\r
55 > The "summary" value is the default and behaves as "notmuch search"
\r
56 > always has, (printing a one-line summary with a bunch of information
\r
57 > about each thread).
\r
59 > Each of the other options causes "notmuch search" to print only a single
\r
60 > value, (thread ID, message ID, filename, or tag), one-per-line[*]. This
\r
61 > is intended to be useful in scripts to do things as follows:
\r
63 > for spamfile in $(notmuch search tag:spam); do
\r
69 > I hope people find this useful. See "notmuch help search" for more
\r
74 my $notmuch =3D `notmuch show @ARGV`;
\r
75 my @filenames =3D ();
\r
76 while ($notmuch =3D~ /^\x{0c}message{ .+filename:(.+)$/mg) {
\r
77 push @filenames, $1;
\r
82 my @filenames =3D split /\n/, `notmuch search --output=3Dfiles @ARGV`;
\r
84 Thanks, that will clearly enhance my script.
\r