Re: [PATCH v2] Omit User-Agent: header by default
[notmuch-archives.git] / 3a / be5e87e1226eb7e0d0c8a9eee3acd344197038
1 Return-Path: <m.walters@qmul.ac.uk>\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 371FA429E37\r
6         for <notmuch@notmuchmail.org>; Tue,  4 Nov 2014 00:58:50 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 3c0Sy8otcRZX for <notmuch@notmuchmail.org>;\r
17         Tue,  4 Nov 2014 00:58:46 -0800 (PST)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id D7E6E429E35\r
22         for <notmuch@notmuchmail.org>; Tue,  4 Nov 2014 00:58:45 -0800 (PST)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1XlZwV-00026G-7W; Tue, 04 Nov 2014 08:58:41 +0000\r
27 Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1XlZwU-0002Lx-SP; Tue, 04 Nov 2014 08:58:23 +0000\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH v2 07/10] cli: search: Convert --output to keyword\r
34  argument\r
35 In-Reply-To: <1415058622-21162-8-git-send-email-sojkam1@fel.cvut.cz>\r
36 References: <1415058622-21162-1-git-send-email-sojkam1@fel.cvut.cz>\r
37         <1415058622-21162-8-git-send-email-sojkam1@fel.cvut.cz>\r
38 User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1\r
39         (x86_64-pc-linux-gnu)\r
40 Date: Tue, 04 Nov 2014 08:58:19 +0000\r
41 Message-ID: <87389z4a1g.fsf@qmul.ac.uk>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 X-Sender-Host-Address: 87.81.223.162\r
45 X-QM-Geographic: According to ripencc,\r
46         this message was delivered by a machine in Britain (UK) (GB).\r
47 X-QM-SPAM-Info: Sender has good ham record.  :)\r
48 X-QM-Body-MD5: 2ffed30c683d5ec2a31957858d855520 (of first 20000 bytes)\r
49 X-SpamAssassin-Score: -0.1\r
50 X-SpamAssassin-SpamBar: /\r
51 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
52         determine if it is\r
53         spam. We require at least 5.0 points to mark a message as spam.\r
54         This message scored -0.1 points.\r
55         Summary of the scoring: \r
56         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
57         provider *      (markwalters1009[at]gmail.com)\r
58         * -0.1 AWL AWL: From: address is in the auto white-list\r
59 X-QM-Scan-Virus: ClamAV says the message is clean\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Tue, 04 Nov 2014 08:58:50 -0000\r
73 \r
74 \r
75 Hi\r
76 \r
77 On Mon, 03 Nov 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
78 > Now, when address related outputs are in a separate command, it makes\r
79 > no sense to combine multiple --output options in search command line.\r
80 > Using switch statement to handle different outputs is more readable\r
81 > than a series of if statements.\r
82 \r
83 I am not keen on this change: I think the user should always be able to\r
84 force the default output by setting command line options (which should\r
85 protect against future changes in the default). Thus I would like to\r
86 continue to allow  --output=sender --output=recipients. \r
87 \r
88 I do approve of making the default do something useful but whether it\r
89 should be both or just sender (which is much faster) is unclear to me.\r
90 \r
91 Best wishes\r
92 \r
93 Mark\r
94 \r
95  \r
96 > ---\r
97 >  doc/man1/notmuch-search.rst |  3 ---\r
98 >  notmuch-search.c            | 25 +++++++++++++------------\r
99 >  2 files changed, 13 insertions(+), 15 deletions(-)\r
100 >\r
101 > diff --git a/doc/man1/notmuch-search.rst b/doc/man1/notmuch-search.rst\r
102 > index 65df288..0cc2911 100644\r
103 > --- a/doc/man1/notmuch-search.rst\r
104 > +++ b/doc/man1/notmuch-search.rst\r
105 > @@ -78,9 +78,6 @@ Supported options for **search** include\r
106 >              by null characters (--format=text0), as a JSON array\r
107 >              (--format=json), or as an S-Expression list (--format=sexp).\r
108 >  \r
109 > -     This option can be given multiple times to combine different\r
110 > -     outputs.\r
111 > -\r
112 >      ``--sort=``\ (**newest-first**\ \|\ **oldest-first**)\r
113 >          This option can be used to present results in either\r
114 >          chronological order (**oldest-first**) or reverse chronological\r
115 > diff --git a/notmuch-search.c b/notmuch-search.c\r
116 > index cbd84f5..402e860 100644\r
117 > --- a/notmuch-search.c\r
118 > +++ b/notmuch-search.c\r
119 > @@ -593,7 +593,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
120 >      int opt_index, ret;\r
121 >  \r
122 >      notmuch_opt_desc_t options[] = {\r
123 > -     { NOTMUCH_OPT_KEYWORD_FLAGS, &ctx->output, "output", 'o',\r
124 > +     { NOTMUCH_OPT_KEYWORD, &ctx->output, "output", 'o',\r
125 >         (notmuch_keyword_t []){ { "summary", OUTPUT_SUMMARY },\r
126 >                                 { "threads", OUTPUT_THREADS },\r
127 >                                 { "messages", OUTPUT_MESSAGES },\r
128 > @@ -607,13 +607,11 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
129 >       { 0, 0, 0, 0, 0 }\r
130 >      };\r
131 >  \r
132 > +    ctx->output = OUTPUT_SUMMARY;\r
133 >      opt_index = parse_arguments (argc, argv, options, 1);\r
134 >      if (opt_index < 0)\r
135 >       return EXIT_FAILURE;\r
136 >  \r
137 > -    if (! ctx->output)\r
138 > -     ctx->output = OUTPUT_SUMMARY;\r
139 > -\r
140 >      if (ctx->output != OUTPUT_FILES && ctx->output != OUTPUT_MESSAGES &&\r
141 >       ctx->dupe != -1) {\r
142 >          fprintf (stderr, "Error: --duplicate=N is only supported with --output=files and --output=messages.\n");\r
143 > @@ -624,17 +622,20 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
144 >                                argc - opt_index, argv + opt_index))\r
145 >       return EXIT_FAILURE;\r
146 >  \r
147 > -    if (ctx->output == OUTPUT_SUMMARY ||\r
148 > -     ctx->output == OUTPUT_THREADS)\r
149 > +    switch (ctx->output) {\r
150 > +    case OUTPUT_SUMMARY:\r
151 > +    case OUTPUT_THREADS:\r
152 >       ret = do_search_threads (ctx);\r
153 > -    else if (ctx->output == OUTPUT_MESSAGES ||\r
154 > -          ctx->output == OUTPUT_FILES)\r
155 > +     break;\r
156 > +    case OUTPUT_MESSAGES:\r
157 > +    case OUTPUT_FILES:\r
158 >       ret = do_search_messages (ctx);\r
159 > -    else if (ctx->output == OUTPUT_TAGS)\r
160 > +     break;\r
161 > +    case OUTPUT_TAGS:\r
162 >       ret = do_search_tags (ctx);\r
163 > -    else {\r
164 > -     fprintf (stderr, "Error: the combination of outputs is not supported.\n");\r
165 > -     ret = 1;\r
166 > +     break;\r
167 > +    default:\r
168 > +     INTERNAL_ERROR ("Unexpected output");\r
169 >      }\r
170 >  \r
171 >      _notmuch_search_cleanup (ctx);\r
172 > -- \r
173 > 2.1.1\r
174 >\r
175 > _______________________________________________\r
176 > notmuch mailing list\r
177 > notmuch@notmuchmail.org\r
178 > http://notmuchmail.org/mailman/listinfo/notmuch\r