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 2DDF0429E3A for ; Mon, 3 Nov 2014 22:52:29 -0800 (PST) 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 QFs5AWnutDkE for ; Mon, 3 Nov 2014 22:52:22 -0800 (PST) Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 110CD431FC4 for ; Mon, 3 Nov 2014 22:52:22 -0800 (PST) Received: from remotemail by yantan.tethera.net with local (Exim 4.80) (envelope-from ) id 1XlXyX-0001jt-3y; Tue, 04 Nov 2014 02:52:21 -0400 Received: (nullmailer pid 26307 invoked by uid 1000); Tue, 04 Nov 2014 06:52:15 -0000 From: David Bremner To: Michal Sojka , notmuch@notmuchmail.org Subject: Re: [PATCH v2 06/10] cli: Introduce "notmuch address" command In-Reply-To: <1415058622-21162-7-git-send-email-sojkam1@fel.cvut.cz> References: <1415058622-21162-1-git-send-email-sojkam1@fel.cvut.cz> <1415058622-21162-7-git-send-email-sojkam1@fel.cvut.cz> User-Agent: Notmuch/0.18.2+156~g3cc8ed5 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Tue, 04 Nov 2014 07:52:15 +0100 Message-ID: <87d293mp9c.fsf@maritornes.cs.unb.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 06:52:29 -0000 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. > + > + ``--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.