--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 1940F429E49\r
+ for <notmuch@notmuchmail.org>; Tue, 25 Feb 2014 11:25:15 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ 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 a3gJ5zM1S6h4 for <notmuch@notmuchmail.org>;\r
+ Tue, 25 Feb 2014 11:25:07 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id CACFA429E43\r
+ for <notmuch@notmuchmail.org>; Tue, 25 Feb 2014 11:25:06 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 5F985100064;\r
+ Tue, 25 Feb 2014 21:24:59 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] cli: command line option parser cleanup\r
+In-Reply-To: <1393277818-8430-1-git-send-email-jani@nikula.org>\r
+References: <1393277818-8430-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.17+108~gb327c11 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 25 Feb 2014 21:24:58 +0200\r
+Message-ID: <m2sir7hu5x.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Tue, 25 Feb 2014 19:25:15 -0000\r
+\r
+On Mon, Feb 24 2014, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> Reduce the indentation for clarity. No functional changes.\r
+>\r
+> ---\r
+\r
+LGTM. I like the style.\r
+\r
+Tomi\r
+\r
+\r
+>\r
+> I've had this around for a while now, in preparation for something\r
+> else that was never needed...\r
+> ---\r
+> command-line-arguments.c | 69 ++++++++++++++++++++++++------------------------\r
+> 1 file changed, 35 insertions(+), 34 deletions(-)\r
+>\r
+> diff --git a/command-line-arguments.c b/command-line-arguments.c\r
+> index bf9aecabe869..844d6c3d18bf 100644\r
+> --- a/command-line-arguments.c\r
+> +++ b/command-line-arguments.c\r
+> @@ -129,40 +129,41 @@ parse_option (const char *arg,\r
+> \r
+> const notmuch_opt_desc_t *try;\r
+> for (try = options; try->opt_type != NOTMUCH_OPT_END; try++) {\r
+> - if (try->name && strncmp (arg, try->name, strlen (try->name)) == 0) {\r
+> - char next = arg[strlen (try->name)];\r
+> - const char *value= arg+strlen(try->name)+1;\r
+> -\r
+> - /* If we have not reached the end of the argument\r
+> - (i.e. the next character is not a space or delimiter)\r
+> - then the argument could still match a longer option\r
+> - name later in the option table.\r
+> - */\r
+> - if (next != '=' && next != ':' && next != '\0')\r
+> - continue;\r
+> -\r
+> - if (try->output_var == NULL)\r
+> - INTERNAL_ERROR ("output pointer NULL for option %s", try->name);\r
+> -\r
+> - switch (try->opt_type) {\r
+> - case NOTMUCH_OPT_KEYWORD:\r
+> - return _process_keyword_arg (try, next, value);\r
+> - break;\r
+> - case NOTMUCH_OPT_BOOLEAN:\r
+> - return _process_boolean_arg (try, next, value);\r
+> - break;\r
+> - case NOTMUCH_OPT_INT:\r
+> - return _process_int_arg (try, next, value);\r
+> - break;\r
+> - case NOTMUCH_OPT_STRING:\r
+> - return _process_string_arg (try, next, value);\r
+> - break;\r
+> - case NOTMUCH_OPT_POSITION:\r
+> - case NOTMUCH_OPT_END:\r
+> - default:\r
+> - INTERNAL_ERROR ("unknown or unhandled option type %d", try->opt_type);\r
+> - /*UNREACHED*/\r
+> - }\r
+> + if (! try->name)\r
+> + continue;\r
+> +\r
+> + if (strncmp (arg, try->name, strlen (try->name)) != 0)\r
+> + continue;\r
+> +\r
+> + char next = arg[strlen (try->name)];\r
+> + const char *value = arg + strlen(try->name) + 1;\r
+> +\r
+> + /*\r
+> + * If we have not reached the end of the argument (i.e. the\r
+> + * next character is not a space or delimiter) then the\r
+> + * argument could still match a longer option name later in\r
+> + * the option table.\r
+> + */\r
+> + if (next != '=' && next != ':' && next != '\0')\r
+> + continue;\r
+> +\r
+> + if (try->output_var == NULL)\r
+> + INTERNAL_ERROR ("output pointer NULL for option %s", try->name);\r
+> +\r
+> + switch (try->opt_type) {\r
+> + case NOTMUCH_OPT_KEYWORD:\r
+> + return _process_keyword_arg (try, next, value);\r
+> + case NOTMUCH_OPT_BOOLEAN:\r
+> + return _process_boolean_arg (try, next, value);\r
+> + case NOTMUCH_OPT_INT:\r
+> + return _process_int_arg (try, next, value);\r
+> + case NOTMUCH_OPT_STRING:\r
+> + return _process_string_arg (try, next, value);\r
+> + case NOTMUCH_OPT_POSITION:\r
+> + case NOTMUCH_OPT_END:\r
+> + default:\r
+> + INTERNAL_ERROR ("unknown or unhandled option type %d", try->opt_type);\r
+> + /*UNREACHED*/\r
+> }\r
+> }\r
+> fprintf (stderr, "Unrecognized option: --%s\n", arg);\r
+> -- \r
+> 1.8.5.3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r