Re: [PATCH v2] Omit User-Agent: header by default
[notmuch-archives.git] / 15 / 0be894d308652488c0eaacb8e787272069584b
1 Return-Path: <sojkam1@fel.cvut.cz>\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 68CA5429E48\r
6         for <notmuch@notmuchmail.org>; Sat,  1 Nov 2014 17:50:38 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 xIq6h8nMMv6n for <notmuch@notmuchmail.org>;\r
16         Sat,  1 Nov 2014 17:50:32 -0700 (PDT)\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
18         by olra.theworths.org (Postfix) with ESMTP id A0FE9431E64\r
19         for <notmuch@notmuchmail.org>; Sat,  1 Nov 2014 17:50:15 -0700 (PDT)\r
20 Received: from localhost (unknown [192.168.200.7])\r
21         by max.feld.cvut.cz (Postfix) with ESMTP id 0CA2B5CD287;\r
22         Sun,  2 Nov 2014 01:50:15 +0100 (CET)\r
23 X-Virus-Scanned: IMAP STYX AMAVIS\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])\r
25         by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,\r
26         port 10044)\r
27         with ESMTP id o_krpALX-RRe; Sun,  2 Nov 2014 01:50:10 +0100 (CET)\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
29         by max.feld.cvut.cz (Postfix) with ESMTP id 6E55E5CD294;\r
30         Sun,  2 Nov 2014 01:50:07 +0100 (CET)\r
31 Received: from wsh by steelpick.2x.cz with local (Exim 4.84)\r
32         (envelope-from <sojkam1@fel.cvut.cz>)\r
33         id 1XkjMq-000856-Gh; Sun, 02 Nov 2014 01:50:04 +0100\r
34 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH 05/10] cli: add support for hierarchical command line option\r
37         arrays\r
38 Date: Sun,  2 Nov 2014 01:49:55 +0100\r
39 Message-Id: <1414889400-30977-6-git-send-email-sojkam1@fel.cvut.cz>\r
40 X-Mailer: git-send-email 2.1.1\r
41 In-Reply-To: <1414889400-30977-1-git-send-email-sojkam1@fel.cvut.cz>\r
42 References: <1414889400-30977-1-git-send-email-sojkam1@fel.cvut.cz>\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Sun, 02 Nov 2014 00:50:38 -0000\r
56 \r
57 From: Jani Nikula <jani@nikula.org>\r
58 \r
59 NOTMUCH_OPT_INHERIT expects a notmuch_opt_desc_t * pointer in\r
60 output_var.\r
61 ---\r
62  command-line-arguments.c | 14 ++++++++------\r
63  command-line-arguments.h |  1 +\r
64  2 files changed, 9 insertions(+), 6 deletions(-)\r
65 \r
66 diff --git a/command-line-arguments.c b/command-line-arguments.c\r
67 index c6f7269..60a0138 100644\r
68 --- a/command-line-arguments.c\r
69 +++ b/command-line-arguments.c\r
70 @@ -122,16 +122,18 @@ parse_position_arg (const char *arg_str, int pos_arg_index,\r
71   */\r
72  \r
73  notmuch_bool_t\r
74 -parse_option (const char *arg,\r
75 -             const notmuch_opt_desc_t *options) {\r
76 -\r
77 -    assert(arg);\r
78 +parse_option (const char *_arg, const notmuch_opt_desc_t *options)\r
79 +{\r
80 +    assert(_arg);\r
81      assert(options);\r
82  \r
83 -    arg += 2;\r
84 -\r
85 +    const char *arg = _arg + 2; /* _arg starts with -- */\r
86      const notmuch_opt_desc_t *try;\r
87      for (try = options; try->opt_type != NOTMUCH_OPT_END; try++) {\r
88 +       if (try->opt_type == NOTMUCH_OPT_INHERIT &&\r
89 +           parse_option (_arg, try->output_var))\r
90 +           return TRUE;\r
91 +\r
92         if (! try->name)\r
93             continue;\r
94  \r
95 diff --git a/command-line-arguments.h b/command-line-arguments.h\r
96 index 6444129..309aaf2 100644\r
97 --- a/command-line-arguments.h\r
98 +++ b/command-line-arguments.h\r
99 @@ -5,6 +5,7 @@\r
100  \r
101  enum notmuch_opt_type {\r
102      NOTMUCH_OPT_END = 0,\r
103 +    NOTMUCH_OPT_INHERIT,       /* another options table */\r
104      NOTMUCH_OPT_BOOLEAN,       /* --verbose              */\r
105      NOTMUCH_OPT_INT,           /* --frob=8               */\r
106      NOTMUCH_OPT_KEYWORD,       /* --format=raw|json|text */\r
107 -- \r
108 2.1.1\r
109 \r