--- /dev/null
+Return-Path: <novalazy@gmail.com>\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 8D090431FBF\r
+ for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 18:43:36 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_FROM=0.001, 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 2AKb3fQvrL8N for <notmuch@notmuchmail.org>;\r
+ Fri, 13 Apr 2012 18:43:36 -0700 (PDT)\r
+Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com\r
+ [209.85.210.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 0CC19431FAE\r
+ for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 18:43:35 -0700 (PDT)\r
+Received: by dacx6 with SMTP id x6so4544874dac.18\r
+ for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 18:43:35 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+ bh=lmn8Aj6p+epysJlCbiJEigYuq4f8RB5x6He9rAQDvaU=;\r
+ b=lOjcKBmt/uT6C7E7aKD6wt5KCvvv9LFcA6Y5Gv5Ckuco+6u45bANDaWXG/PFR/qOMF\r
+ hBZGxcEF6oJUXmUpuRYJ8rs0TMrOQOQEz/bafolnTukt+BVb36jvg6R/1+d/CudiF1k/\r
+ QTAltpm405/AN2GvCoT1nRmvsbm0JhnZqChNnHrWZ9uJxkIRkPgcz4w+ph/ZvCpaVM5x\r
+ 2qHcTeo2H159j+clakLk2j2kRX+luQL7s/LBSMYAvGgt4Cqc0xPb42geLBf9mqcRW2t9\r
+ ZF4mx/hcHdHXJox+/DxPvUXElfHpKBsK3Kf7h7xbvhzLom20Za6engNsIG7qcS4R+zKQ\r
+ KjlA==\r
+Received: by 10.68.204.234 with SMTP id lb10mr8752105pbc.161.1334367815380;\r
+ Fri, 13 Apr 2012 18:43:35 -0700 (PDT)\r
+Received: from localhost (215.42.233.220.static.exetel.com.au.\r
+ [220.233.42.215])\r
+ by mx.google.com with ESMTPS id y5sm10267958pbk.5.2012.04.13.18.43.31\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Fri, 13 Apr 2012 18:43:34 -0700 (PDT)\r
+From: Peter Wang <novalazy@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 2/6] config: Check 'config get' arity exactly\r
+Date: Sat, 14 Apr 2012 11:41:02 +1000\r
+Message-Id: <1334367666-10954-3-git-send-email-novalazy@gmail.com>\r
+X-Mailer: git-send-email 1.7.4.4\r
+In-Reply-To: <1334367666-10954-1-git-send-email-novalazy@gmail.com>\r
+References: <1332282698-7951-1-git-send-email-novalazy@gmail.com>\r
+ <1334367666-10954-1-git-send-email-novalazy@gmail.com>\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: Sat, 14 Apr 2012 01:43:36 -0000\r
+\r
+Require that 'config get' is passed exactly one additional argument,\r
+instead of silently ignoring extra arguments. As a side-effect, produce\r
+more specific error messages for the 'config' command as a whole.\r
+---\r
+ notmuch-config.c | 19 +++++++++++++++----\r
+ 1 files changed, 15 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/notmuch-config.c b/notmuch-config.c\r
+index 85fc774..f9eb977 100644\r
+--- a/notmuch-config.c\r
++++ b/notmuch-config.c\r
+@@ -804,15 +804,26 @@ notmuch_config_command (void *ctx, int argc, char *argv[])\r
+ {\r
+ argc--; argv++; /* skip subcommand argument */\r
+ \r
+- if (argc < 2) {\r
+- fprintf (stderr, "Error: notmuch config requires at least two arguments.\n");\r
++ if (argc < 1) {\r
++ fprintf (stderr, "Error: notmuch config requires at least one argument.\n");\r
+ return 1;\r
+ }\r
+ \r
+- if (strcmp (argv[0], "get") == 0)\r
++ if (strcmp (argv[0], "get") == 0) {\r
++ if (argc != 2) {\r
++ fprintf (stderr, "Error: notmuch config get requires exactly "\r
++ "one argument.\n");\r
++ return 1;\r
++ }\r
+ return notmuch_config_command_get (ctx, argv[1]);\r
+- else if (strcmp (argv[0], "set") == 0)\r
++ } else if (strcmp (argv[0], "set") == 0) {\r
++ if (argc < 2) {\r
++ fprintf (stderr, "Error: notmuch config set requires at least "\r
++ "one argument.\n");\r
++ return 1;\r
++ }\r
+ return notmuch_config_command_set (ctx, argv[1], argc - 2, argv + 2);\r
++ }\r
+ \r
+ fprintf (stderr, "Unrecognized argument for notmuch config: %s\n",\r
+ argv[0]);\r
+-- \r
+1.7.4.4\r
+\r