1 Return-Path: <markwalters1009@gmail.com>
\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 552F9429E30
\r
6 for <notmuch@notmuchmail.org>; Thu, 8 Mar 2012 14:16:19 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id vx2K6KgDUkQL for <notmuch@notmuchmail.org>;
\r
18 Thu, 8 Mar 2012 14:16:18 -0800 (PST)
\r
19 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com
\r
20 [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 8DC22429E27
\r
23 for <notmuch@notmuchmail.org>; Thu, 8 Mar 2012 14:16:16 -0800 (PST)
\r
24 Received: by werm13 with SMTP id m13so793870wer.26
\r
25 for <notmuch@notmuchmail.org>; Thu, 08 Mar 2012 14:16:15 -0800 (PST)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=bP2rRCZwXRLS8yBbOvNWmbOKQpJVnEY/ccKTPWySWOk=;
\r
29 b=o+EdwDawQHAuuexEaZYv7pnNqUY/TiddgOdbS3SIr7JlsNd9ue0moKoVeijeW5qyni
\r
30 Ii/VS5L+kS4ZYLuJcNvYTDioEtuhokKgQiGGtyWEWcApkCVm+T6d5aFeNBq96aEzYmIC
\r
31 aegbhgYlDZERlW/xarGCf7sLcJpYDPAKxWIZk51GDbsW2r4434EDuL2+Jwc4UowSvcaY
\r
32 eCFdGHCu6RWlp14bha9+CvBi5eGA3Yc8zXGyQ6OYR9ZR9nvCEByPksLnHYLxvjka1lyk
\r
33 LAuA3bIVpJL8u6Z8HVYsmkbwhCodoD5iHRDSyQY14BdWkCgX2PpBZRa0+1kIQ2cqGUhB
\r
35 Received: by 10.216.138.38 with SMTP id z38mr4176822wei.63.1331244975317;
\r
36 Thu, 08 Mar 2012 14:16:15 -0800 (PST)
\r
37 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.
\r
38 [94.192.233.223]) by mx.google.com with ESMTPS id
\r
39 fw5sm47328264wib.0.2012.03.08.14.16.13 (version=TLSv1/SSLv3 cipher=OTHER);
\r
40 Thu, 08 Mar 2012 14:16:14 -0800 (PST)
\r
41 From: Mark Walters <markwalters1009@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH 2/2] cli: make --entire-thread option notmuch-show.c
\r
45 Date: Thu, 8 Mar 2012 22:15:44 +0000
\r
46 Message-Id: <1331244944-7960-3-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 1.7.9.1
\r
48 In-Reply-To: <1331244944-7960-1-git-send-email-markwalters1009@gmail.com>
\r
49 References: <1331244944-7960-1-git-send-email-markwalters1009@gmail.com>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Thu, 08 Mar 2012 22:16:19 -0000
\r
64 Make the --entire-thread option notmuch-show.c
\r
65 NOTMUCH_OPT_INT_OR_BOOLEAN. In particular this means a caller can turn
\r
66 off entire-thread (by specifying --entire-thread=0) when format=json.
\r
67 (This was not previously possible.)
\r
69 notmuch-show.c | 10 ++++++++--
\r
70 1 files changed, 8 insertions(+), 2 deletions(-)
\r
72 diff --git a/notmuch-show.c b/notmuch-show.c
\r
73 index 05d51b2..f0c640f 100644
\r
74 --- a/notmuch-show.c
\r
75 +++ b/notmuch-show.c
\r
76 @@ -985,6 +985,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
77 const notmuch_show_format_t *format = &format_text;
\r
78 notmuch_show_params_t params = { .part = -1 };
\r
79 int format_sel = NOTMUCH_FORMAT_NOT_SPECIFIED;
\r
80 + int entire_thread = -1;
\r
81 notmuch_bool_t verify = FALSE;
\r
82 notmuch_bool_t no_exclude = FALSE;
\r
84 @@ -996,7 +997,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
85 { "raw", NOTMUCH_FORMAT_RAW },
\r
87 { NOTMUCH_OPT_INT, ¶ms.part, "part", 'p', 0 },
\r
88 - { NOTMUCH_OPT_BOOLEAN, ¶ms.entire_thread, "entire-thread", 't', 0 },
\r
89 + { NOTMUCH_OPT_INT_OR_BOOLEAN, &entire_thread, "entire-thread", 't', 0 },
\r
90 { NOTMUCH_OPT_BOOLEAN, ¶ms.decrypt, "decrypt", 'd', 0 },
\r
91 { NOTMUCH_OPT_BOOLEAN, &verify, "verify", 'v', 0 },
\r
92 { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'n', 0 },
\r
93 @@ -1020,7 +1021,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
94 switch (format_sel) {
\r
95 case NOTMUCH_FORMAT_JSON:
\r
96 format = &format_json;
\r
97 - params.entire_thread = TRUE;
\r
98 + if (entire_thread == -1)
\r
99 + entire_thread = 1;
\r
101 case NOTMUCH_FORMAT_TEXT:
\r
102 format = &format_text;
\r
103 @@ -1042,6 +1044,10 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
\r
107 + /* Set default to not entire_thread; JSON case dealt with above */
\r
108 + if (entire_thread == -1)
\r
109 + entire_thread = 0;
\r
110 + params.entire_thread = notmuch_int_to_boolean (entire_thread);
\r
112 if (params.decrypt || verify) {
\r
113 #ifdef GMIME_ATLEAST_26
\r