From: Tomi Ollila Date: Tue, 4 Nov 2014 09:40:04 +0000 (+0200) Subject: Re: [PATCH v2 06/10] cli: Introduce "notmuch address" command X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5acdd74fb1775fec10012494854cdf2e92a7db0f;p=notmuch-archives.git Re: [PATCH v2 06/10] cli: Introduce "notmuch address" command --- diff --git a/d1/716a5bcb99290ed004f988fa5afc3438bcf432 b/d1/716a5bcb99290ed004f988fa5afc3438bcf432 new file mode 100644 index 000000000..abd23a17e --- /dev/null +++ b/d1/716a5bcb99290ed004f988fa5afc3438bcf432 @@ -0,0 +1,130 @@ +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 64A31429E3B + for ; Tue, 4 Nov 2014 12:19:09 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.103 +X-Spam-Level: * +X-Spam-Status: No, score=1.103 tagged_above=-999 required=5 + tests=[DATE_IN_PAST_06_12=1.103] 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 vku6xIQ8kwOW for ; + Tue, 4 Nov 2014 12:19:01 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 2A891431FCF + for ; Tue, 4 Nov 2014 12:19:01 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id BA860100033; + Tue, 4 Nov 2014 11:40:04 +0200 (EET) +From: Tomi Ollila +To: David Bremner , Michal Sojka , + notmuch@notmuchmail.org +Subject: Re: [PATCH v2 06/10] cli: Introduce "notmuch address" command +In-Reply-To: <87d293mp9c.fsf@maritornes.cs.unb.ca> +References: <1415058622-21162-1-git-send-email-sojkam1@fel.cvut.cz> + <1415058622-21162-7-git-send-email-sojkam1@fel.cvut.cz> + <87d293mp9c.fsf@maritornes.cs.unb.ca> +User-Agent: Notmuch/0.18.2+169~g5bcdd1c (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: Tue, 04 Nov 2014 20:19:09 -0000 + +On Tue, Nov 04 2014, David Bremner wrote: + +> Michal Sojka writes: +> +>> +{ +>> + local cur prev words cword split +>> + _init_completion -s || return +>> + +>> + $split && +>> + case "${prev}" in +>> + --format) +>> + COMPREPLY=( $( compgen -W "json sexp text text0" -- "${cur}" ) ) +>> + return +>> + ;; +>> + --output) +>> + COMPREPLY=( $( compgen -W "sender recipients" -- "${cur}" ) ) +>> + return +>> + ;; +>> + --sort) +>> + COMPREPLY=( $( compgen -W "newest-first oldest-first" -- "${cur}" ) ) +>> + return +>> + ;; +>> + --exclude) +>> + COMPREPLY=( $( compgen -W "true false flag all" -- "${cur}" ) ) +>> + return +>> + ;; +>> + esac +>> + +>> + ! $split && +>> + case "${cur}" in +>> + -*) +>> + local options="--format= --output= --sort= --exclude=" +>> + compopt -o nospace +>> + COMPREPLY=( $(compgen -W "$options" -- ${cur}) ) +>> + ;; +>> + *) +>> + _notmuch_search_terms +>> + ;; +>> + esac +>> +} +>> + +> +> I am reminded that we have no tests for shell completion stuff, which +> seems pretty fragile. + +That is what users are for -- i.e. the completion testing monkies ! ;D +> +>> + +>> + ``--format=``\ (**json**\ \|\ **sexp**\ \|\ **text**\ \|\ **text0**) +>> + Presents the results in either JSON, S-Expressions, newline +>> + character separated plain-text (default), or null character +>> + separated plain-text (compatible with **xargs(1)** -0 option +>> + where available). +>> + +>> + ``--format-version=N`` +>> + Use the specified structured output format version. This is +>> + intended for programs that invoke **notmuch(1)** internally. If +>> + omitted, the latest supported version will be used. +>> + +> +> +> I wonder if at some point we should have a notmuch-output-formats.7 page. +> +> +>> + ``--exclude=(true|false|all|flag)`` +>> + A message is called "excluded" if it matches at least one tag in +>> + search.tag\_exclude that does not appear explicitly in the +>> + search terms. This option specifies whether to omit excluded +>> + messages in the search process. +> +> Similarly for excludes. I'm ok with the duplication for now, and I can +> see an argument for not making the user chase references. +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch