From 31bc3957be0fee28893e1cae0d3e604c60aafb3b Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 10 Mar 2012 11:23:15 +0000 Subject: [PATCH] Re: [PATCH 0/3] argument parsing additions --- 73/68ab2bcf2dc5c55033a70c4a2a7393be043498 | 136 ++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 73/68ab2bcf2dc5c55033a70c4a2a7393be043498 diff --git a/73/68ab2bcf2dc5c55033a70c4a2a7393be043498 b/73/68ab2bcf2dc5c55033a70c4a2a7393be043498 new file mode 100644 index 000000000..593cb40c3 --- /dev/null +++ b/73/68ab2bcf2dc5c55033a70c4a2a7393be043498 @@ -0,0 +1,136 @@ +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 05ABB431FBC + for ; Sat, 10 Mar 2012 03:23:18 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 c-Dlm+tbsLyf for ; + Sat, 10 Mar 2012 03:23:17 -0800 (PST) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 43EC3431FAE + for ; Sat, 10 Mar 2012 03:23:17 -0800 (PST) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1S6KOG-0002J3-Tv; Sat, 10 Mar 2012 11:23:13 +0000 +Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] + helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1S6KOG-0006xi-LA; Sat, 10 Mar 2012 11:23:12 +0000 +From: Mark Walters +To: Jani Nikula , notmuch@notmuchmail.org +Subject: Re: [PATCH 0/3] argument parsing additions +In-Reply-To: +References: <87399iicit.fsf@qmul.ac.uk> +User-Agent: Notmuch/0.11.1+309~g045f9e7 (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-pc-linux-gnu) +Date: Sat, 10 Mar 2012 11:23:15 +0000 +Message-ID: <87vcmchf8c.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 94.192.233.223 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 8ed9cd8bbdeab3c8e90a62b9e2a4962b (of first 20000 bytes) +X-SpamAssassin-Score: -1.8 +X-SpamAssassin-SpamBar: - +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -1.8 points. + Summary of the scoring: + * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, + * medium trust + * [138.37.6.40 listed in list.dnswl.org] + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay + * domain + * 0.5 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Sat, 10 Mar 2012 11:23:18 -0000 + +On Sat, 10 Mar 2012 00:33:27 +0200, Jani Nikula wrote: +> Hi Mark - +> +> I'm not sure which is worse, criticizing or rewriting other people's +> patches. I already did the former, and now I'm doing the +> latter. Apologies for both. I didn't really mean to write these patches, +> but it turned out to be more fun writing a proper reply in C than in +> English. +> +> Patch 1 adds --arg=true and --arg=false support for booleans. It's not +> strictly required for the --entire-thread support in patch 3, which uses +> the extension of keyword arguments from patch 2, but it's for +> consistency across boolean arguments. + +Hi + +I like patch 1: I have an almost identical to my version (in the series +I just sent to the list +id:"1331377533-30262-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1"). + +I am not sure about patch 2 and patch 3. Do you have a use case for +--option except when option is a boolean? Otherwise I think I prefer either my +approach (abusing a notmuch_bool_t) or just adding an option +NOTMUCH_OPT_BOOLEAN_AS_INT which does boolean parsing but returns an +int. I guess I am saying that I think allowing boolean options which can +sometimes default to true and sometimes to false is more useful than +allowing --option for arbitrary keywords (*). + +What do you think? + +Best wishes + +Mark + +(*) Indeed, I was thinking of the former as a possibility for the +exclude code, but I am erring towards just using keywords so I can allow +more options as you suggested. + + +> +> Please let me know what you think. +> +> BR, +> Jani. +> +> +> Jani Nikula (3): +> command-line-arguments: allow true and false keywords for booleans +> command-line-arguments: support keyword arguments with default value +> cli: allow switching off entire thread mode in notmuch show json +> format +> +> command-line-arguments.c | 45 +++++++++++++++++++++++++++++++++++++++------ +> command-line-arguments.h | 1 + +> notmuch-show.c | 12 ++++++++++-- +> 3 files changed, 50 insertions(+), 8 deletions(-) +> +> -- +> 1.7.5.4 +> -- 2.26.2