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 D9EDC431E82 for ; Tue, 4 Nov 2014 14:00:08 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[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 47myDmS1cY+x for ; Tue, 4 Nov 2014 14:00:01 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 80FF6431FAE for ; Tue, 4 Nov 2014 14:00:01 -0800 (PST) Received: from localhost (unknown [192.168.200.7]) by max.feld.cvut.cz (Postfix) with ESMTP id 0C1E15CD17F; Tue, 4 Nov 2014 22:59:58 +0100 (CET) X-Virus-Scanned: IMAP STYX AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10044) with ESMTP id n5ATZ5kLYTw6; Tue, 4 Nov 2014 22:59:53 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 986285CD170; Tue, 4 Nov 2014 22:59:53 +0100 (CET) Received: from wsh by steelpick.2x.cz with local (Exim 4.84) (envelope-from ) id 1Xlm8h-0006bO-Vg; Tue, 04 Nov 2014 22:59:47 +0100 From: Michal Sojka To: David Bremner , 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+157~ga00d359 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Tue, 04 Nov 2014 22:59:47 +0100 Message-ID: <871tpimxt8.fsf@steelpick.2x.cz> 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 22:00: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. > >> + >> + ``--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. What about using RST include directive [1] to include shared parts into more documents? [1] http://docutils.sourceforge.net/docs/ref/rst/directives.html#including-an-external-document-fragment -Michal