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 55EA9431FBD
\r
6 for <notmuch@notmuchmail.org>; Sat, 1 Dec 2012 18:40:15 -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 Xmh9k2ANhgx8 for <notmuch@notmuchmail.org>;
\r
16 Sat, 1 Dec 2012 18:40:14 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id C1895431FC0
\r
20 for <notmuch@notmuchmail.org>; Sat, 1 Dec 2012 18:40:13 -0800 (PST)
\r
21 X-AuditID: 1209190f-b7fec6d00000090d-88-50babf8cdec6
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 8F.F5.02317.C8FBAB05; Sat, 1 Dec 2012 21:40:12 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id qB22eCdv013713;
\r
27 Sat, 1 Dec 2012 21:40:12 -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 qB22e61V025596
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Sat, 1 Dec 2012 21:40:10 -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 1TezTR-0000xV-SV; Sat, 01 Dec 2012 21:40:05 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 03/10] show: Support --use-schema
\r
41 Date: Sat, 1 Dec 2012 21:39:55 -0500
\r
42 Message-Id: <1354416002-3557-3-git-send-email-amdragon@mit.edu>
\r
43 X-Mailer: git-send-email 1.7.10.4
\r
44 In-Reply-To: <1354416002-3557-1-git-send-email-amdragon@mit.edu>
\r
45 References: <1354416002-3557-1-git-send-email-amdragon@mit.edu>
\r
46 X-Brightmail-Tracker:
\r
47 H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixCmqrNuzf1eAwYVtFhbXb85kdmD0eLbq
\r
48 FnMAYxSXTUpqTmZZapG+XQJXxu2LXcwFt4Qr+o8XNzDe4O9i5OSQEDCR2PStlw3CFpO4cG89
\r
49 kM3FISSwj1Hi+9xXrBDOekaJBxfWMUI4D5kkjveuYoFw5jJKnH86hR2kn01AQ2Lb/uWMILaI
\r
50 gLTEzruzgdo5OJgF1CT+dKmAhIUFDCW2PG4HK2cRUJV4eP8MC4jNK2Av8eTBARaIMxQlup9N
\r
51 YANp5RRwkFjRzQMSFgIq+f/7GtsERv4FjAyrGGVTcqt0cxMzc4pTk3WLkxPz8lKLdE30cjNL
\r
52 9FJTSjcxgkNGkn8H47eDSocYBTgYlXh4GWftChBiTSwrrsw9xCjJwaQkyntlB1CILyk/pTIj
\r
53 sTgjvqg0J7X4EKMEB7OSCC+LCVCONyWxsiq1KB8mJc3BoiTOezXlpr+QQHpiSWp2ampBahFM
\r
54 VoaDQ0mCt3ofUKNgUWp6akVaZk4JQpqJgxNkOA/Q8Ed7QYYXFyTmFmemQ+RPMSpKifNeA0kI
\r
55 gCQySvPgemEx/YpRHOgVYV5PkBU8wHQA1/0KaDAT0OA3y7aDDC5JREhJNTBWN398sqLlomNB
\r
56 0NVIVi7F4t9xK4+ecuq6xXE37MQMixs2DMdDfhfIar1caeEtcrJbxnLJhcM+yzXUKhVl1mtd
\r
57 +ZPleb/x8TtP+50xDI4FdZxtC1/u+PlgRbzmHsk1sactZs3/LtAW8nMb0zbmdSY/j+rfe/D/
\r
58 zIcH25dcNpzm4qPzNTlE8+EMJZbijERDLeai4kQAIttqPcQCAAA=
\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, 02 Dec 2012 02:40:15 -0000
\r
74 man/man1/notmuch-show.1 | 20 ++++++++++++++++++++
\r
75 notmuch-client.h | 2 ++
\r
76 notmuch-show.c | 3 +++
\r
77 3 files changed, 25 insertions(+)
\r
79 diff --git a/man/man1/notmuch-show.1 b/man/man1/notmuch-show.1
\r
80 index 4481f21..e2fd0c2 100644
\r
81 --- a/man/man1/notmuch-show.1
\r
82 +++ b/man/man1/notmuch-show.1
\r
83 @@ -108,6 +108,15 @@ message.
\r
87 +.BR \-\-use-schema=N
\r
89 +Use the specified structured output schema version. This is intended
\r
90 +for programs that invoke \fBnotmuch\fR(1) internally. If omitted, the
\r
91 +latest supported version will be used.
\r
98 Output the single decoded MIME part N of a single message. The search
\r
99 @@ -181,6 +190,17 @@ column of output from the
\r
105 +This command supports the following special exit status codes
\r
109 +The requested schema version is too old.
\r
112 +The requested schema version is too new.
\r
116 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
\r
117 diff --git a/notmuch-client.h b/notmuch-client.h
\r
118 index 95c4dd7..d931bbf 100644
\r
119 --- a/notmuch-client.h
\r
120 +++ b/notmuch-client.h
\r
121 @@ -142,6 +142,8 @@ chomp_newline (char *str)
\r
122 #define NOTMUCH_SCHEMA_CUR 1
\r
123 /* The minimum schema version supported by the "search" command. */
\r
124 #define NOTMUCH_SCHEMA_SEARCH 1
\r
125 +/* The minimum schema version supported by the "show" command. */
\r
126 +#define NOTMUCH_SCHEMA_SHOW 1
\r
128 /* The schema version requested by the caller on the command line. If
\r
129 * no schema version is requested, this should be set to
\r
130 diff --git a/notmuch-show.c b/notmuch-show.c
\r
131 index 2fa2292..9d1f7c7 100644
\r
132 --- a/notmuch-show.c
\r
133 +++ b/notmuch-show.c
\r
134 @@ -1059,6 +1059,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
135 { "mbox", NOTMUCH_FORMAT_MBOX },
\r
136 { "raw", NOTMUCH_FORMAT_RAW },
\r
138 + { NOTMUCH_OPT_INT, ¬much_schema_version, "use-schema", 0, 0 },
\r
139 { NOTMUCH_OPT_KEYWORD, &exclude, "exclude", 'x',
\r
140 (notmuch_keyword_t []){ { "true", EXCLUDE_TRUE },
\r
141 { "false", EXCLUDE_FALSE },
\r
142 @@ -1118,6 +1119,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
146 + notmuch_exit_if_unsupported_schema ("show", NOTMUCH_SCHEMA_SHOW);
\r
148 /* Default is entire-thread = FALSE except for format=json. */
\r
149 if (entire_thread == ENTIRE_THREAD_DEFAULT) {
\r
150 if (format == &format_json)
\r