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 4F809431FC0
\r
6 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:29 -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 FowfaireEszM for <notmuch@notmuchmail.org>;
\r
17 Sun, 16 Dec 2012 14:05:27 -0800 (PST)
\r
18 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com
\r
19 [209.85.217.181]) (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 37AB1429E34
\r
22 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:27 -0800 (PST)
\r
23 Received: by mail-lb0-f181.google.com with SMTP id ge1so4072140lbb.26
\r
24 for <notmuch@notmuchmail.org>; Sun, 16 Dec 2012 14:05:25 -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=h+5ItNnYKblODbKUDb/r/dljMhbz3lBRx6ePs+998jY=;
\r
30 b=aaeoIjp6e9qwq6Y7NqSel9xIRLILnofEEq5/qrpuyigDc8x2FnoVZ4v2wrWWNxjDEh
\r
31 L5pFruAfKHctt3CyWFZb4y5AddksoHXgiulgX1i5Q74LPvcUPf2x4OeZ0fpLD70rHF1A
\r
32 PZtnHD/1qtJiJ+P5aDu4rTwk0DLzqhZJ37ofh0HRpmwbaXW+jCKqTcyOsC3NMhzhY5gE
\r
33 ZyldDBsT6o3VwpNG6Y0AST+Mpw/ekJ4G2k4IStujSo87nRXTsoUxGKjVTXC8Elz4TP2Y
\r
34 rmjQT2h9G8bCy6lYI069UkKTu4Owb+SDUOl/55MCX4WlYgMbHHLXc9NS3eZ+w6dzfsKA
\r
36 Received: by 10.152.124.111 with SMTP id mh15mr8860466lab.20.1355695525542;
\r
37 Sun, 16 Dec 2012 14:05:25 -0800 (PST)
\r
38 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPS id sj3sm4118153lab.2.2012.12.16.14.05.23
\r
41 (version=SSLv3 cipher=OTHER); Sun, 16 Dec 2012 14:05:24 -0800 (PST)
\r
42 From: Jani Nikula <jani@nikula.org>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v4 3/5] cli: add --format=text0 to notmuch search
\r
45 Date: Mon, 17 Dec 2012 00:05:11 +0200
\r
47 <ac2e9d6223e58349afd798828a8ad433528af5cf.1355695036.git.jani@nikula.org>
\r
48 X-Mailer: git-send-email 1.7.10.4
\r
49 In-Reply-To: <cover.1355695036.git.jani@nikula.org>
\r
50 References: <cover.1355695036.git.jani@nikula.org>
\r
51 In-Reply-To: <cover.1355695036.git.jani@nikula.org>
\r
52 References: <cover.1355695036.git.jani@nikula.org>
\r
54 ALoCoQno4Qdn5eWkkQXuQKOn5sztPnwXuxK93yNhpX/D5m68IacpIyr+BWlF8XY4ZbQpRC56y9ly
\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 22:05:29 -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 7704915..0b0a879 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_INT, ¬much_format_version, "format-version", 0, 0 },
\r
103 { NOTMUCH_OPT_KEYWORD, &output, "output", 'o',
\r
104 @@ -346,6 +351,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