From e0ff3d4af82430da2fff357bbc9f9fd6b3b676f3 Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Tue, 10 Apr 2012 18:31:00 +1000 Subject: [PATCH] Re: [PATCH v3 4/5] config: Add 'config list' command --- 83/4a362fc52e76ca67fea4a08b3994df5be75985 | 101 ++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 83/4a362fc52e76ca67fea4a08b3994df5be75985 diff --git a/83/4a362fc52e76ca67fea4a08b3994df5be75985 b/83/4a362fc52e76ca67fea4a08b3994df5be75985 new file mode 100644 index 000000000..29dae60f5 --- /dev/null +++ b/83/4a362fc52e76ca67fea4a08b3994df5be75985 @@ -0,0 +1,101 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 96B58431FAF + for ; Tue, 10 Apr 2012 01:31:04 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id GxfpTsV5B4sn for ; + Tue, 10 Apr 2012 01:31:04 -0700 (PDT) +Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com + [209.85.210.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 00859431FAE + for ; Tue, 10 Apr 2012 01:31:03 -0700 (PDT) +Received: by dacx6 with SMTP id x6so6483837dac.18 + for ; Tue, 10 Apr 2012 01:31:03 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=date:message-id:from:to:cc:subject:in-reply-to:references + :mime-version:content-type:content-disposition + :content-transfer-encoding; + bh=HOSbZa6VqfnX8Bcegk9WGqgfCD8BgV3jKj+jDT/piuQ=; + b=PmTrwE33WLDuUL1XVstK1KxAyF8WMQXxjXOSJU2z9+uOIHF+35EmrdUMP8hureeNXF + LRwbt2n/Ya4EHBqNYAeB93stNkOE7hytolm3qIdaMT+xf4eiylqfrsvDEtwTNHN41GWv + HvDkX/MqDVYRzkokJRO752b58C5DZ1bI9oqKLZ6d7BzV+3nfST8EH9DWgxF/3Z4tYG0f + ShROAsOJIgNl31S57CQ5jxRBi7/BD8eY4naTeiT3eAwRzr4c/2FSEBAurnJodaoIrQNp + XDVNFjhob44YFIoqzmM9wlIh7Kf3tEuddQQqpL3jFgOs12u3AB7jG4httFmYyMm2+vhi + RDDA== +Received: by 10.68.213.104 with SMTP id nr8mr11786726pbc.91.1334046663095; + Tue, 10 Apr 2012 01:31:03 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id r9sm17317748pbi.53.2012.04.10.01.31.00 + (version=TLSv1/SSLv3 cipher=OTHER); + Tue, 10 Apr 2012 01:31:02 -0700 (PDT) +Date: Tue, 10 Apr 2012 18:31:00 +1000 +Message-ID: <20120410183100.GJ8657@hili.localdomain> +From: Peter Wang +To: Jameson Graef Rollins +Subject: Re: [PATCH v3 4/5] config: Add 'config list' command +In-Reply-To: <87r4vwhx0m.fsf@servo.finestructure.net> +References: <1332282698-7951-1-git-send-email-novalazy@gmail.com> + <1333676886-9835-1-git-send-email-novalazy@gmail.com> + <1333676886-9835-5-git-send-email-novalazy@gmail.com> + <87r4vwhx0m.fsf@servo.finestructure.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Disposition: inline +Content-Transfer-Encoding: 8bit +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 10 Apr 2012 08:31:04 -0000 + +On Tue, 10 Apr 2012 00:22:01 -0700, Jameson Graef Rollins wrote: +> On Thu, Apr 05 2012, Peter Wang wrote: +> +> > - if (strcmp (argv[0], "get") == 0) +> > + if (strcmp (argv[0], "get") == 0) { +> > + if (argc < 2) { +> > + fprintf (stderr, "Error: notmuch config get requires at least " +> > + "two arguments.\n"); +> > + return 1; +> > + } +> > return notmuch_config_command_get (ctx, argv[1]); +> > - else if (strcmp (argv[0], "set") == 0) +> > + } else if (strcmp (argv[0], "set") == 0) { +> > + if (argc < 2) { +> > + fprintf (stderr, "Error: notmuch config set requires at least " +> > + "two arguments.\n"); +> > + return 1; +> > + } +> > return notmuch_config_command_set (ctx, argv[1], argc - 2, argv + 2); +> +> But then these changes look unrelated to me. They do look good +> intentioned, though. It's probably best to submit these changes in a +> separate unrelated patch. + +Well, the only reason to duplicate the arity check is due to the +introduction of the 'list' subcommand. But I see that the error +messages are wrong anyway, so I will separate out the changes in another +patch series. + +Peter -- 2.26.2