--- /dev/null
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 68CA5429E48\r
+ for <notmuch@notmuchmail.org>; Sat, 1 Nov 2014 17:50:38 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id xIq6h8nMMv6n for <notmuch@notmuchmail.org>;\r
+ Sat, 1 Nov 2014 17:50:32 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by olra.theworths.org (Postfix) with ESMTP id A0FE9431E64\r
+ for <notmuch@notmuchmail.org>; Sat, 1 Nov 2014 17:50:15 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.7])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 0CA2B5CD287;\r
+ Sun, 2 Nov 2014 01:50:15 +0100 (CET)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,\r
+ port 10044)\r
+ with ESMTP id o_krpALX-RRe; Sun, 2 Nov 2014 01:50:10 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 6E55E5CD294;\r
+ Sun, 2 Nov 2014 01:50:07 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.84)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1XkjMq-000856-Gh; Sun, 02 Nov 2014 01:50:04 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 05/10] cli: add support for hierarchical command line option\r
+ arrays\r
+Date: Sun, 2 Nov 2014 01:49:55 +0100\r
+Message-Id: <1414889400-30977-6-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 2.1.1\r
+In-Reply-To: <1414889400-30977-1-git-send-email-sojkam1@fel.cvut.cz>\r
+References: <1414889400-30977-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 02 Nov 2014 00:50:38 -0000\r
+\r
+From: Jani Nikula <jani@nikula.org>\r
+\r
+NOTMUCH_OPT_INHERIT expects a notmuch_opt_desc_t * pointer in\r
+output_var.\r
+---\r
+ command-line-arguments.c | 14 ++++++++------\r
+ command-line-arguments.h | 1 +\r
+ 2 files changed, 9 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/command-line-arguments.c b/command-line-arguments.c\r
+index c6f7269..60a0138 100644\r
+--- a/command-line-arguments.c\r
++++ b/command-line-arguments.c\r
+@@ -122,16 +122,18 @@ parse_position_arg (const char *arg_str, int pos_arg_index,\r
+ */\r
+ \r
+ notmuch_bool_t\r
+-parse_option (const char *arg,\r
+- const notmuch_opt_desc_t *options) {\r
+-\r
+- assert(arg);\r
++parse_option (const char *_arg, const notmuch_opt_desc_t *options)\r
++{\r
++ assert(_arg);\r
+ assert(options);\r
+ \r
+- arg += 2;\r
+-\r
++ const char *arg = _arg + 2; /* _arg starts with -- */\r
+ const notmuch_opt_desc_t *try;\r
+ for (try = options; try->opt_type != NOTMUCH_OPT_END; try++) {\r
++ if (try->opt_type == NOTMUCH_OPT_INHERIT &&\r
++ parse_option (_arg, try->output_var))\r
++ return TRUE;\r
++\r
+ if (! try->name)\r
+ continue;\r
+ \r
+diff --git a/command-line-arguments.h b/command-line-arguments.h\r
+index 6444129..309aaf2 100644\r
+--- a/command-line-arguments.h\r
++++ b/command-line-arguments.h\r
+@@ -5,6 +5,7 @@\r
+ \r
+ enum notmuch_opt_type {\r
+ NOTMUCH_OPT_END = 0,\r
++ NOTMUCH_OPT_INHERIT, /* another options table */\r
+ NOTMUCH_OPT_BOOLEAN, /* --verbose */\r
+ NOTMUCH_OPT_INT, /* --frob=8 */\r
+ NOTMUCH_OPT_KEYWORD, /* --format=raw|json|text */\r
+-- \r
+2.1.1\r
+\r