[PATCH 3/4] Add documentation for user.other_name
[notmuch-archives.git] / 8d / 7fbbed48560843285896be907a97c455fd8ed7
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 3A56B429E41\r
6         for <notmuch@notmuchmail.org>; Tue,  4 Nov 2014 01:08:43 -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 z-lEPwolnr9s for <notmuch@notmuchmail.org>;\r
17         Tue,  4 Nov 2014 01:08:39 -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 04EB2429E37\r
22         for <notmuch@notmuchmail.org>; Tue,  4 Nov 2014 01:08:39 -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 1Xla65-0005qY-Eu; Tue, 04 Nov 2014 09:08:37 +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 1Xla64-0004J4-Vr; Tue, 04 Nov 2014 09:08:17 +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: <87389z4a1g.fsf@qmul.ac.uk>\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         <87389z4a1g.fsf@qmul.ac.uk>\r
39 User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1\r
40         (x86_64-pc-linux-gnu)\r
41 Date: Tue, 04 Nov 2014 09:08:16 +0000\r
42 Message-ID: <87wq7b2v0f.fsf@qmul.ac.uk>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 X-Sender-Host-Address: 87.81.223.162\r
46 X-QM-Geographic: According to ripencc,\r
47         this message was delivered by a machine in Britain (UK) (GB).\r
48 X-QM-SPAM-Info: Sender has good ham record.  :)\r
49 X-QM-Body-MD5: f500e3addfb64b38de9f247ac468aa3b (of first 20000 bytes)\r
50 X-SpamAssassin-Score: -0.1\r
51 X-SpamAssassin-SpamBar: /\r
52 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
53         determine if it is\r
54         spam. We require at least 5.0 points to mark a message as spam.\r
55         This message scored -0.1 points.\r
56         Summary of the scoring: \r
57         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
58         provider *      (markwalters1009[at]gmail.com)\r
59         * -0.1 AWL AWL: From: address is in the auto white-list\r
60 X-QM-Scan-Virus: ClamAV says the message is clean\r
61 X-BeenThere: notmuch@notmuchmail.org\r
62 X-Mailman-Version: 2.1.13\r
63 Precedence: list\r
64 List-Id: "Use and development of the notmuch mail system."\r
65         <notmuch.notmuchmail.org>\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
69 List-Post: <mailto:notmuch@notmuchmail.org>\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
73 X-List-Received-Date: Tue, 04 Nov 2014 09:08:43 -0000\r
74 \r
75 \r
76 > Hi\r
77 >\r
78 > On Mon, 03 Nov 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
79 >> Now, when address related outputs are in a separate command, it makes\r
80 >> no sense to combine multiple --output options in search command line.\r
81 >> Using switch statement to handle different outputs is more readable\r
82 >> than a series of if statements.\r
83 >\r
84 > I am not keen on this change: I think the user should always be able to\r
85 > force the default output by setting command line options (which should\r
86 > protect against future changes in the default). Thus I would like to\r
87 > continue to allow  --output=sender --output=recipients. \r
88 >\r
89 > I do approve of making the default do something useful but whether it\r
90 > should be both or just sender (which is much faster) is unclear to me.\r
91 \r
92 Sorry my stupidity: you said "search" not "address" so this is fine.\r
93 \r
94 Best wishes\r
95 \r
96 Mark\r
97 \r
98 >\r
99 > Best wishes\r
100 >\r
101 > Mark\r
102 >\r
103 >  \r
104 >> ---\r
105 >>  doc/man1/notmuch-search.rst |  3 ---\r
106 >>  notmuch-search.c            | 25 +++++++++++++------------\r
107 >>  2 files changed, 13 insertions(+), 15 deletions(-)\r
108 >>\r
109 >> diff --git a/doc/man1/notmuch-search.rst b/doc/man1/notmuch-search.rst\r
110 >> index 65df288..0cc2911 100644\r
111 >> --- a/doc/man1/notmuch-search.rst\r
112 >> +++ b/doc/man1/notmuch-search.rst\r
113 >> @@ -78,9 +78,6 @@ Supported options for **search** include\r
114 >>              by null characters (--format=text0), as a JSON array\r
115 >>              (--format=json), or as an S-Expression list (--format=sexp).\r
116 >>  \r
117 >> -    This option can be given multiple times to combine different\r
118 >> -    outputs.\r
119 >> -\r
120 >>      ``--sort=``\ (**newest-first**\ \|\ **oldest-first**)\r
121 >>          This option can be used to present results in either\r
122 >>          chronological order (**oldest-first**) or reverse chronological\r
123 >> diff --git a/notmuch-search.c b/notmuch-search.c\r
124 >> index cbd84f5..402e860 100644\r
125 >> --- a/notmuch-search.c\r
126 >> +++ b/notmuch-search.c\r
127 >> @@ -593,7 +593,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
128 >>      int opt_index, ret;\r
129 >>  \r
130 >>      notmuch_opt_desc_t options[] = {\r
131 >> -    { NOTMUCH_OPT_KEYWORD_FLAGS, &ctx->output, "output", 'o',\r
132 >> +    { NOTMUCH_OPT_KEYWORD, &ctx->output, "output", 'o',\r
133 >>        (notmuch_keyword_t []){ { "summary", OUTPUT_SUMMARY },\r
134 >>                                { "threads", OUTPUT_THREADS },\r
135 >>                                { "messages", OUTPUT_MESSAGES },\r
136 >> @@ -607,13 +607,11 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
137 >>      { 0, 0, 0, 0, 0 }\r
138 >>      };\r
139 >>  \r
140 >> +    ctx->output = OUTPUT_SUMMARY;\r
141 >>      opt_index = parse_arguments (argc, argv, options, 1);\r
142 >>      if (opt_index < 0)\r
143 >>      return EXIT_FAILURE;\r
144 >>  \r
145 >> -    if (! ctx->output)\r
146 >> -    ctx->output = OUTPUT_SUMMARY;\r
147 >> -\r
148 >>      if (ctx->output != OUTPUT_FILES && ctx->output != OUTPUT_MESSAGES &&\r
149 >>      ctx->dupe != -1) {\r
150 >>          fprintf (stderr, "Error: --duplicate=N is only supported with --output=files and --output=messages.\n");\r
151 >> @@ -624,17 +622,20 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
152 >>                               argc - opt_index, argv + opt_index))\r
153 >>      return EXIT_FAILURE;\r
154 >>  \r
155 >> -    if (ctx->output == OUTPUT_SUMMARY ||\r
156 >> -    ctx->output == OUTPUT_THREADS)\r
157 >> +    switch (ctx->output) {\r
158 >> +    case OUTPUT_SUMMARY:\r
159 >> +    case OUTPUT_THREADS:\r
160 >>      ret = do_search_threads (ctx);\r
161 >> -    else if (ctx->output == OUTPUT_MESSAGES ||\r
162 >> -         ctx->output == OUTPUT_FILES)\r
163 >> +    break;\r
164 >> +    case OUTPUT_MESSAGES:\r
165 >> +    case OUTPUT_FILES:\r
166 >>      ret = do_search_messages (ctx);\r
167 >> -    else if (ctx->output == OUTPUT_TAGS)\r
168 >> +    break;\r
169 >> +    case OUTPUT_TAGS:\r
170 >>      ret = do_search_tags (ctx);\r
171 >> -    else {\r
172 >> -    fprintf (stderr, "Error: the combination of outputs is not supported.\n");\r
173 >> -    ret = 1;\r
174 >> +    break;\r
175 >> +    default:\r
176 >> +    INTERNAL_ERROR ("Unexpected output");\r
177 >>      }\r
178 >>  \r
179 >>      _notmuch_search_cleanup (ctx);\r
180 >> -- \r
181 >> 2.1.1\r
182 >>\r
183 >> _______________________________________________\r
184 >> notmuch mailing list\r
185 >> notmuch@notmuchmail.org\r
186 >> http://notmuchmail.org/mailman/listinfo/notmuch\r