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 8CB27431FB6 for ; Wed, 6 Feb 2013 23:43:50 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 OZ0JZahKDuIA for ; Wed, 6 Feb 2013 23:43:48 -0800 (PST) Received: from mail-bk0-f44.google.com (mail-bk0-f44.google.com [209.85.214.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id A5D97431FAF for ; Wed, 6 Feb 2013 23:43:48 -0800 (PST) Received: by mail-bk0-f44.google.com with SMTP id j4so1023213bkw.3 for ; Wed, 06 Feb 2013 23:43:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:x-gm-message-state; bh=tOsrWtKxsy9uojNq1+QJ7/HMf5MpkA19A4c/fGppRS8=; b=KWZE7tJr1tGwKgvMQxAeYnXSLJ3FeKNGWBfyhe8Q2ZMhCX2x4J+zA3s9gQO5cEsDb4 XWuvx/OryJ+2pPMWzJycaht7JNdv5vo8vAR0FUceblHOdR1kb8XJxh+v3E5a0APZpuDE oJgwF8D3DrffGqPnqa/JHlSqiULYhD4f4HgisTj9OPpL1fJeuprmPlO+aJ+jWrldvpGC XZfY9bMJ/BDK+Iu9kRuKE0dMz4aOk47/9Z1VGTko1z5aQP6BzN7FbNIfd5/Neg8ruIBf xEb442tXDcjZVuCYZ70jSuUITkW/0z2U35mbmev6c0lhxvD5XHK/zfG/ZBmHIB0hJAOq y96A== X-Received: by 10.204.129.16 with SMTP id m16mr80625bks.103.1360223025419; Wed, 06 Feb 2013 23:43:45 -0800 (PST) Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) by mx.google.com with ESMTPS id x10sm8735663bkv.13.2013.02.06.23.43.41 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 06 Feb 2013 23:43:43 -0800 (PST) From: Jani Nikula To: Jameson Graef Rollins , notmuch@notmuchmail.org Subject: Re: [PATCH 0/6] notmuch cli config changes In-Reply-To: <871ucts54t.fsf@servo.finestructure.net> References: <871ucts54t.fsf@servo.finestructure.net> User-Agent: Notmuch/0.14+259~gdee88db (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Thu, 07 Feb 2013 08:43:34 +0100 Message-ID: <878v70lgbd.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQkqQhUolnBCy5Oe1AaoYAx/mwpdMSKb6jTjf0Cs4FzZ3yICGElry404ww+1Wjge7g2kWong 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: Thu, 07 Feb 2013 07:43:50 -0000 On Wed, 06 Feb 2013, Jameson Graef Rollins wrote: > On Tue, Jan 29 2013, Jani Nikula wrote: >> Hi all, the goal here is to add support for --config=FILE option at the >> notmuch top level (e.g. 'notmuch --config=FILE search foo'). In order to >> achieve this neatly, I ended up moving config open/close to main() from >> subcommands. This isn't a bad thing, because all notmuch commands opened >> the config file anyway. > > Hi, Jani. I appreciate you've put a lot of work into this series, but > I'll be the same devil's advocate that I was to David previously. Why > do we need a command line option here when we already have an > environment variable that handles just this? Is there some benefit to > having a command line option for this that I don't see? I see this as > another instance of an option that regular users will rarely use, if > ever. Fair enough. In any case I see patches 1-4, and to an extent also patch 5, as useful refactoring and cleanup. Also, if we ever end up having any top level arguments that need to be passed to subcommands, I think patches 1-5 are good prep work. The config struct could be extended to include both settings from the config file and settings from the top level arguments. But this is just a bonus in addition to the refactoring part. > In general, I am a strong advocate of keeping the CLI slim. IMHO, > adding more options makes the interface clunkier, and the manual harder > to parse, and I'm against adding things that a normal user would likely > never use. In retrospect, I should have had the same objection to the > --format-version option, which I think could have just been an env var > as well. What is a "normal user"? I'm a user too. BR, Jani.