--- /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 1A9F6431FD2\r
+ for <notmuch@notmuchmail.org>; Tue, 4 Nov 2014 16:26:26 -0800 (PST)\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 KtR01dhhAkKx for <notmuch@notmuchmail.org>;\r
+ Tue, 4 Nov 2014 16:26:18 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by olra.theworths.org (Postfix) with ESMTP id 8CA87431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 4 Nov 2014 16:26:18 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.7])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 959D25CD1B3;\r
+ Wed, 5 Nov 2014 01:26:17 +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 ePLw06xGE8iN; Wed, 5 Nov 2014 01:26:13 +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 7A67A5CD1A9;\r
+ Wed, 5 Nov 2014 01:26:13 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.84)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1XloQI-0005Cx-SD; Wed, 05 Nov 2014 01:26:06 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 05/10] cli: add support for hierarchical command line\r
+ option arrays\r
+Date: Wed, 5 Nov 2014 01:25:54 +0100\r
+Message-Id: <1415147159-19946-6-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 2.1.1\r
+In-Reply-To: <1415147159-19946-1-git-send-email-sojkam1@fel.cvut.cz>\r
+References: <1415147159-19946-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: Wed, 05 Nov 2014 00:26:26 -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
+The "Unrecognized option" message was moved out of parse_option() to\r
+not be emitted twice or when parsing a non-inherited option.\r
+---\r
+ command-line-arguments.c | 16 +++++++++-------\r
+ command-line-arguments.h | 1 +\r
+ 2 files changed, 10 insertions(+), 7 deletions(-)\r
+\r
+diff --git a/command-line-arguments.c b/command-line-arguments.c\r
+index c6f7269..de6b453 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
+@@ -170,7 +172,6 @@ parse_option (const char *arg,\r
+ /*UNREACHED*/\r
+ }\r
+ }\r
+- fprintf (stderr, "Unrecognized option: --%s\n", arg);\r
+ return FALSE;\r
+ }\r
+ \r
+@@ -201,6 +202,7 @@ parse_arguments (int argc, char **argv,\r
+ if (more_args) {\r
+ opt_index++;\r
+ } else {\r
++ fprintf (stderr, "Unrecognized option: %s\n", argv[opt_index]);\r
+ opt_index = -1;\r
+ }\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