--- /dev/null
+Return-Path: <jani@nikula.org>\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 70D44431FD9\r
+ for <notmuch@notmuchmail.org>; Mon, 24 Feb 2014 13:37:09 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 DVPXWLzJqU6K for <notmuch@notmuchmail.org>;\r
+ Mon, 24 Feb 2014 13:37:04 -0800 (PST)\r
+Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com\r
+ [209.85.215.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id BA332431FCF\r
+ for <notmuch@notmuchmail.org>; Mon, 24 Feb 2014 13:37:03 -0800 (PST)\r
+Received: by mail-ea0-f182.google.com with SMTP id r15so3383638ead.41\r
+ for <notmuch@notmuchmail.org>; Mon, 24 Feb 2014 13:37:01 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
+ bh=wSbr8duGCT9hvlRony3ddtM4SvxrXYoLxxMQb2NDEGM=;\r
+ b=GYo+SLt4N7R0d1SqSAd2OIMDo1Y6207azxmY3xfFVlFpBoB3DXh3frTaU6SXCqMWED\r
+ fnTkDn/lUEAVqZGgFvgzDnYUB6BvDzK1r0eJG8oQK8G1gtVRKdGlJCKmf2u5TMXyNiOa\r
+ U9+/3BeWDlvWklh8/7aIrjaBaztSf4cnNCbnigdZgi4WUEanDGGWagikhwoU7KQQOv7D\r
+ QYGmz0r7cJUp6iZkcQqgOlBrvAS0ZLYoTtid/zIwtB+NVT72aE5Qh5cwEFn+EEV+4RUH\r
+ FD1l68gh/Q3rXKIDznx3ezabAAkC2ZWQbvu5Zws/PwwnUVN1uv6q8TYvEbLFcjKWIE5Y\r
+ PDFw==\r
+X-Gm-Message-State:\r
+ ALoCoQk0tqOcpb3qeXLo+MfPO9M+3FYU+6/xhZ6PbE8T7yIqVx8B1fP8iycUeODBg56o95L+rYW8\r
+X-Received: by 10.14.1.68 with SMTP id 44mr27323853eec.0.1393277821014;\r
+ Mon, 24 Feb 2014 13:37:01 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+ [88.195.111.91])\r
+ by mx.google.com with ESMTPSA id n48sm47572595eew.0.2014.02.24.13.36.59\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Mon, 24 Feb 2014 13:37:00 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] cli: command line option parser cleanup\r
+Date: Mon, 24 Feb 2014 23:36:58 +0200\r
+Message-Id: <1393277818-8430-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.8.5.3\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: Mon, 24 Feb 2014 21:37:09 -0000\r
+\r
+Reduce the indentation for clarity. No functional changes.\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