1 Return-Path: <jani@nikula.org>
\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 B38F640B3C1
\r
6 for <notmuch@notmuchmail.org>; Sat, 31 Aug 2013 23:09:47 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 yW0-0hcGZAbi for <notmuch@notmuchmail.org>;
\r
17 Sat, 31 Aug 2013 23:09:40 -0700 (PDT)
\r
18 Received: from mail-ea0-f176.google.com (mail-ea0-f176.google.com
\r
19 [209.85.215.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 9CA524092A2
\r
22 for <notmuch@notmuchmail.org>; Sat, 31 Aug 2013 03:34:35 -0700 (PDT)
\r
23 Received: by mail-ea0-f176.google.com with SMTP id q16so1368329ead.21
\r
24 for <notmuch@notmuchmail.org>; Sat, 31 Aug 2013 03:34:34 -0700 (PDT)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=1e100.net; s=20130820;
\r
27 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
28 :references:in-reply-to:references;
\r
29 bh=ZnhhC7XApbFkgF9OpO+tRYHvFu2qFGDAUH/mfO1H2Hw=;
\r
30 b=iGiu/77GaysNVwv5jBPzzqCAImugIzdc7Ym3ex87ujSZBGxQ1AMgIgD2BRhdj349zR
\r
31 fDalnM7/vG3uDTxRHZfKP8BN1PrAtp+xoNX9wysT3c1guVhFR0gFEsILtFA0Rz9wq547
\r
32 uREe0UYGUsas01q1SvPsuxR0QZCSKCD8ZYMkphIsOb182X8iVKxZgxKXVX4jcGqma2n8
\r
33 Iijzr4xiuI38VC/e+eZYY4WFb7darL39t1jk46jUVCyqTAPwq1LMWaFHA9pTGgkT+9iV
\r
34 KSkBEeNR8/9YBmGqfo2nNk0kSg5j066zZKNjBhGHaUBYp7RuLYu/63Ch/aR6iVaOwqLr
\r
37 ALoCoQke0PPh68k+FLybKt6+q4/IehUSTm7pu+chKjRhalkPUhJODMm1Z4FxVmjYfrPnqtva6+TF
\r
38 X-Received: by 10.14.177.199 with SMTP id d47mr19831814eem.14.1377945274394;
\r
39 Sat, 31 Aug 2013 03:34:34 -0700 (PDT)
\r
40 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
42 by mx.google.com with ESMTPSA id a43sm4052382eep.9.1969.12.31.16.00.00
\r
43 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
44 Sat, 31 Aug 2013 03:34:33 -0700 (PDT)
\r
45 From: Jani Nikula <jani@nikula.org>
\r
46 To: notmuch@notmuchmail.org
\r
47 Subject: [RFC PATCH 2/2] cli: use global verbose, debug,
\r
48 and no-hooks options in notmuch new
\r
49 Date: Sat, 31 Aug 2013 13:34:31 +0300
\r
51 <d568247bc6b169e51a788611ebee2855705bdba0.1377945239.git.jani@nikula.org>
\r
52 X-Mailer: git-send-email 1.7.10.4
\r
54 <08036456064699510ef832f0c6740d98d324d185.1377945239.git.jani@nikula.org>
\r
56 <08036456064699510ef832f0c6740d98d324d185.1377945239.git.jani@nikula.org>
\r
58 <08036456064699510ef832f0c6740d98d324d185.1377945239.git.jani@nikula.org>
\r
60 <08036456064699510ef832f0c6740d98d324d185.1377945239.git.jani@nikula.org>
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.13
\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: Sun, 01 Sep 2013 06:09:48 -0000
\r
75 Deprecate the old notmuch new options, but keep them around for a
\r
76 transitional period, overriding the top level options.
\r
78 notmuch-new.c | 31 +++++++++++++++++++++++++------
\r
79 1 file changed, 25 insertions(+), 6 deletions(-)
\r
81 diff --git a/notmuch-new.c b/notmuch-new.c
\r
82 index faa33f1..d425103 100644
\r
85 @@ -855,16 +855,21 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
\r
88 notmuch_bool_t timer_is_active = FALSE;
\r
89 - notmuch_bool_t no_hooks = FALSE;
\r
90 + notmuch_bool_t no_hooks = notmuch_global_get_no_hooks (config);
\r
92 - add_files_state.verbose = FALSE;
\r
93 - add_files_state.debug = FALSE;
\r
94 + add_files_state.verbose = notmuch_global_get_verbose (config);
\r
95 + add_files_state.debug = notmuch_global_get_debug (config);
\r
96 add_files_state.output_is_a_tty = isatty (fileno (stdout));
\r
98 + /* transitional, these will go away */
\r
99 + notmuch_bool_t deprecated_verbose = FALSE;
\r
100 + notmuch_bool_t deprecated_debug = FALSE;
\r
101 + notmuch_bool_t deprecated_no_hooks = FALSE;
\r
103 notmuch_opt_desc_t options[] = {
\r
104 - { NOTMUCH_OPT_BOOLEAN, &add_files_state.verbose, "verbose", 'v', 0 },
\r
105 - { NOTMUCH_OPT_BOOLEAN, &add_files_state.debug, "debug", 'd', 0 },
\r
106 - { NOTMUCH_OPT_BOOLEAN, &no_hooks, "no-hooks", 'n', 0 },
\r
107 + { NOTMUCH_OPT_BOOLEAN, &deprecated_verbose, "verbose", 'v', 0 },
\r
108 + { NOTMUCH_OPT_BOOLEAN, &deprecated_debug, "debug", 'd', 0 },
\r
109 + { NOTMUCH_OPT_BOOLEAN, &deprecated_no_hooks, "no-hooks", 'n', 0 },
\r
113 @@ -874,6 +879,20 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[])
\r
117 + /* transitional, these will go away */
\r
118 + if (deprecated_verbose) {
\r
119 + add_files_state.verbose = deprecated_verbose;
\r
120 + fprintf (stderr, "Note: 'notmuch new --verbose' is deprecated. Please use 'notmuch --verbose new' instead.\n");
\r
122 + if (deprecated_debug) {
\r
123 + add_files_state.debug = deprecated_debug;
\r
124 + fprintf (stderr, "Note: 'notmuch new --debug' is deprecated. Please use 'notmuch --debug new' instead.\n");
\r
126 + if (deprecated_no_hooks) {
\r
127 + no_hooks = deprecated_no_hooks;
\r
128 + fprintf (stderr, "Note: 'notmuch new --no-hooks' is deprecated. Please use 'notmuch --no-hooks new' instead.\n");
\r
131 add_files_state.new_tags = notmuch_config_get_new_tags (config, &add_files_state.new_tags_length);
\r
132 add_files_state.new_ignore = notmuch_config_get_new_ignore (config, &add_files_state.new_ignore_length);
\r
133 add_files_state.synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config);
\r