1 Return-Path: <amdragon@mit.edu>
\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 3FDAE431FBD
\r
6 for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 19:17:41 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id IM4BuGEOIYA1 for <notmuch@notmuchmail.org>;
\r
16 Sat, 15 Dec 2012 19:17:40 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 86836431FB6
\r
20 for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 19:17:40 -0800 (PST)
\r
21 X-AuditID: 1209190c-b7f886d000000936-19-50cd3d547475
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 98.59.02358.45D3DC05; Sat, 15 Dec 2012 22:17:40 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id qBG3HcIg020941;
\r
27 Sat, 15 Dec 2012 22:17:38 -0500
\r
28 Received: from drake.dyndns.org
\r
29 (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [209.6.116.242]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qBG3Hauw012056
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Sat, 15 Dec 2012 22:17:38 -0500 (EST)
\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)
\r
36 (envelope-from <amdragon@mit.edu>)
\r
37 id 1Tk4jP-0007c3-J5; Sat, 15 Dec 2012 22:17:35 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 2/7] search: Support --format-version
\r
41 Date: Sat, 15 Dec 2012 22:17:24 -0500
\r
42 Message-Id: <1355627849-29099-3-git-send-email-amdragon@mit.edu>
\r
43 X-Mailer: git-send-email 1.7.10.4
\r
44 In-Reply-To: <1355627849-29099-1-git-send-email-amdragon@mit.edu>
\r
45 References: <1355627849-29099-1-git-send-email-amdragon@mit.edu>
\r
46 X-Brightmail-Tracker:
\r
47 H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixCmqrRtiezbAYO5pDovVc3ksrt+cyezA
\r
48 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZczfe4yp4C5/ReOeT8wNjCd4uhg5OSQETCTe
\r
49 XjrGAmGLSVy4t56ti5GLQ0hgH6PEpvl7GSGcDYwSu96fgXIeMUl8/HaaGcKZyyhxp/ssM0g/
\r
50 m4CGxLb9yxlBbBEBaYmdd2ezgtjMAo4Sn/cvYgOxhQVMJQ53LAWrZxFQlfix8ykTiM0r4CDR
\r
51 vaeNDeIORYnuZxPAbE6g3s1bfoLZQkA1s48cZZvAyL+AkWEVo2xKbpVubmJmTnFqsm5xcmJe
\r
52 XmqRrqFebmaJXmpK6SZGcChJ8uxgfHNQ6RCjAAejEg+vxdczAUKsiWXFlbmHGCU5mJREeXMs
\r
53 zwYI8SXlp1RmJBZnxBeV5qQWH2KU4GBWEuFNmg9UzpuSWFmVWpQPk5LmYFES572cctNfSCA9
\r
54 sSQ1OzW1ILUIJivDwaEkwctsAzRUsCg1PbUiLTOnBCHNxMEJMpwHaLgySA1vcUFibnFmOkT+
\r
55 FKOilDjvU2ughABIIqM0D64XFuuvGMWBXhHm1QBp5wGmCbjuV0CDmYAGL7cBubq4JBEhJdXA
\r
56 uPDVy+JTR3fPuGg0591zvwPPvSTLfL971NudStGL0fey+32o+2nyG2b9E5sbNh+xZbx3RcHi
\r
57 0YwJcsKCdw/Whil6/U3ZZLximeb1L5u+ec2tsX6ezPxjQYnOzrSay0E7mHvX7qwxqne4uWtJ
\r
58 341H8xm2fTkXZXVKe/3nvaw3bzceYDblvnj3p60SS3FGoqEWc1FxIgDB24vw0AIAAA==
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Sun, 16 Dec 2012 03:17:41 -0000
\r
74 man/man1/notmuch-search.1 | 20 ++++++++++++++++++++
\r
75 notmuch-search.c | 3 +++
\r
76 2 files changed, 23 insertions(+)
\r
78 diff --git a/man/man1/notmuch-search.1 b/man/man1/notmuch-search.1
\r
79 index 0aff348..5c771fa 100644
\r
80 --- a/man/man1/notmuch-search.1
\r
81 +++ b/man/man1/notmuch-search.1
\r
82 @@ -32,6 +32,15 @@ Presents the results in either JSON, S-Expressions or plain-text (default).
\r
86 +.BR \-\-format-version=N
\r
88 +Use the specified structured output format version. This is intended
\r
89 +for programs that invoke \fBnotmuch\fR(1) internally. If omitted, the
\r
90 +latest supported version will be used.
\r
95 .B \-\-output=(summary|threads|messages|files|tags)
\r
98 @@ -126,6 +135,17 @@ In this case all matching threads are returned but the "match count"
\r
99 is the number of matching non-excluded messages in the thread.
\r
104 +This command supports the following special exit status codes
\r
108 +The requested format version is too old.
\r
111 +The requested format version is too new.
\r
115 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
\r
116 diff --git a/notmuch-search.c b/notmuch-search.c
\r
117 index 6218622..7704915 100644
\r
118 --- a/notmuch-search.c
\r
119 +++ b/notmuch-search.c
\r
120 @@ -318,6 +318,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
121 { "sexp", NOTMUCH_FORMAT_SEXP },
\r
122 { "text", NOTMUCH_FORMAT_TEXT },
\r
124 + { NOTMUCH_OPT_INT, ¬much_format_version, "format-version", 0, 0 },
\r
125 { NOTMUCH_OPT_KEYWORD, &output, "output", 'o',
\r
126 (notmuch_keyword_t []){ { "summary", OUTPUT_SUMMARY },
\r
127 { "threads", OUTPUT_THREADS },
\r
128 @@ -356,6 +357,8 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
129 INTERNAL_ERROR("no output format selected");
\r
132 + notmuch_exit_if_unsupported_format ();
\r
134 config = notmuch_config_open (ctx, NULL, NULL);
\r
135 if (config == NULL)
\r