1 Return-Path: <jani@nikula.org>
\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 959A7431FB6
\r
6 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:56 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\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 Vw+EwPvJjJMI for <notmuch@notmuchmail.org>;
\r
17 Sun, 16 Dec 2012 13:02:56 -0800 (PST)
\r
18 Received: from mail-la0-f53.google.com (mail-la0-f53.google.com
\r
19 [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id EAE68431FAE
\r
22 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:55 -0800 (PST)
\r
23 Received: by mail-la0-f53.google.com with SMTP id w12so4045336lag.26
\r
24 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 13:02:54 -0800 (PST)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=google.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
\r
28 :in-reply-to:references:x-gm-message-state;
\r
29 bh=Y9qPt4eCs0YUlyxgvBEc0UeKVlnfQk8A0m/W2fp5NI0=;
\r
30 b=gzCcGJnX2ZB16g+vELeAZjA4rqNTofO6JHT+ZRKAI9b4GINIywM4RV9YcA82u20PQG
\r
31 bMp/fNTRaU7BN9uE0emsbCCX2EnmrbtQ/A6hmI/VxA7RSU9s8d/yi8QK/E34IdWPrYES
\r
32 izKGxGB+9TMg21ySC2rvAS+c7eHarLVw92eAi1wydK9gNhgBr2zVF+kdXaID+jels6wA
\r
33 xcJl/yy/tBTr1UadBkDolzK7QAagdRWKiL2UKIkaeTI875G228qQ1UsNRMxOPVAMlLum
\r
34 DsjdwCATNfGr+2qr1gZB91b7T6stvtBRvPftceeBtlLeCpQANv7p8Axy7FP+TytBU//+
\r
36 Received: by 10.152.134.243 with SMTP id pn19mr8762203lab.11.1355691774434;
\r
37 Sun, 16 Dec 2012 13:02:54 -0800 (PST)
\r
38 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPS id u5sm4115128lbm.8.2012.12.16.13.02.52
\r
41 (version=SSLv3 cipher=OTHER); Sun, 16 Dec 2012 13:02:53 -0800 (PST)
\r
42 From: Jani Nikula <jani@nikula.org>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v3 3/5] cli: add --format=text0 to notmuch search
\r
45 Date: Sun, 16 Dec 2012 23:02:39 +0200
\r
47 <c655693e090d7fa1a781868f597ed2b19bed3f9c.1355691124.git.jani@nikula.org>
\r
48 X-Mailer: git-send-email 1.7.10.4
\r
49 In-Reply-To: <cover.1355691124.git.jani@nikula.org>
\r
50 References: <cover.1355691124.git.jani@nikula.org>
\r
51 In-Reply-To: <cover.1355691124.git.jani@nikula.org>
\r
52 References: <cover.1355691124.git.jani@nikula.org>
\r
54 ALoCoQkdp4PJo1JoEv8ukJeFurgmG6mYT6JBzB/AZVzI5COl7XwVa+ZWHClq0/IufrFK0/CuUenZ
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Sun, 16 Dec 2012 21:02:56 -0000
\r
69 Add new format text0, which is otherwise the same as text, but use the
\r
70 null character as separator instead of the newline character. This is
\r
71 similar to find(1) -print0 option, and works together with the
\r
74 notmuch-search.c | 16 ++++++++++++++--
\r
75 1 file changed, 14 insertions(+), 2 deletions(-)
\r
77 diff --git a/notmuch-search.c b/notmuch-search.c
\r
78 index 6218622..627962b 100644
\r
79 --- a/notmuch-search.c
\r
80 +++ b/notmuch-search.c
\r
81 @@ -305,8 +305,12 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
82 int exclude = EXCLUDE_TRUE;
\r
85 - enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT, NOTMUCH_FORMAT_SEXP }
\r
86 - format_sel = NOTMUCH_FORMAT_TEXT;
\r
88 + NOTMUCH_FORMAT_JSON,
\r
89 + NOTMUCH_FORMAT_TEXT,
\r
90 + NOTMUCH_FORMAT_TEXT0,
\r
91 + NOTMUCH_FORMAT_SEXP
\r
92 + } format_sel = NOTMUCH_FORMAT_TEXT;
\r
94 notmuch_opt_desc_t options[] = {
\r
95 { NOTMUCH_OPT_KEYWORD, &sort, "sort", 's',
\r
96 @@ -317,6 +321,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
97 (notmuch_keyword_t []){ { "json", NOTMUCH_FORMAT_JSON },
\r
98 { "sexp", NOTMUCH_FORMAT_SEXP },
\r
99 { "text", NOTMUCH_FORMAT_TEXT },
\r
100 + { "text0", NOTMUCH_FORMAT_TEXT0 },
\r
102 { NOTMUCH_OPT_KEYWORD, &output, "output", 'o',
\r
103 (notmuch_keyword_t []){ { "summary", OUTPUT_SUMMARY },
\r
104 @@ -345,6 +350,13 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
105 case NOTMUCH_FORMAT_TEXT:
\r
106 format = sprinter_text_create (ctx, stdout);
\r
108 + case NOTMUCH_FORMAT_TEXT0:
\r
109 + if (output == OUTPUT_SUMMARY) {
\r
110 + fprintf (stderr, "Error: --format=text0 is not compatible with --output=summary.\n");
\r
113 + format = sprinter_text0_create (ctx, stdout);
\r
115 case NOTMUCH_FORMAT_JSON:
\r
116 format = sprinter_json_create (ctx, stdout);
\r