From 936c07e30961bc8eeee4fdc2640bd71f65afcc30 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Thu, 25 Sep 2014 22:13:58 +0300 Subject: [PATCH] Re: [PATCH 1/5] cli: Refactor option passing in the search command --- 72/4c52c28d271d2a141dd361fd51d9b59681dac2 | 90 +++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 72/4c52c28d271d2a141dd361fd51d9b59681dac2 diff --git a/72/4c52c28d271d2a141dd361fd51d9b59681dac2 b/72/4c52c28d271d2a141dd361fd51d9b59681dac2 new file mode 100644 index 000000000..14627a942 --- /dev/null +++ b/72/4c52c28d271d2a141dd361fd51d9b59681dac2 @@ -0,0 +1,90 @@ +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 5EE19431FB6 + for ; Thu, 25 Sep 2014 12:14:14 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 30aYcDaDyjkE for ; + Thu, 25 Sep 2014 12:14:09 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id BF6AB431FAF + for ; Thu, 25 Sep 2014 12:14:09 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 68279100033; + Thu, 25 Sep 2014 22:13:58 +0300 (EEST) +From: Tomi Ollila +To: Michal Sojka , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/5] cli: Refactor option passing in the search command +In-Reply-To: <1411378679-7307-2-git-send-email-sojkam1@fel.cvut.cz> +References: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz> + <1411378679-7307-2-git-send-email-sojkam1@fel.cvut.cz> +User-Agent: Notmuch/0.18.1+97~g6c845ef (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +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, 25 Sep 2014 19:14:14 -0000 + +On Mon, Sep 22 2014, Michal Sojka wrote: + +> Many functions that implement the search command need to access command +> line options. Instead of passing each option in a separate variable, put +> them in a structure and pass only this structure. + +This patch looks good to me. + +Although the test and the implementation in the next patches look OK, I'd +prefer the FLAG implementation Jani suggested earlier. IMO now that I +compare these two it looks cleaner and simpler... + +I.e. I'd prefer notmuch search --output=sender --output=recipients ... +(same output regardless the order these options given). + +I'd postpone the unique handling to a bit later phase; there are quite a +few options how to do that (*) + + +Tomi + +(*) IMO the default unique (when requested) would be exact case-sensitive +match of full name & address parts (phrase, address & comment); then +(a subset of possible) options could be: + +) case-insensitive (first match taken (or last match?) -- option?) + +) unique email addresses (take phrase/comment from first/last?) + -- or use first that has something additional to plain address + -- or use last that has something additional to plain address + + +> This will become handy in the following patches. +> --- +> notmuch-search.c | 122 ++++++++++++++++++++++++++++--------------------------- +> 1 file changed, 62 insertions(+), 60 deletions(-) +> +> diff --git a/notmuch-search.c b/notmuch-search.c +> index bc9be45..5ac2a26 100644 +> --- a/notmuch-search.c +> +++ b/notmuch-search.c -- 2.26.2