--- /dev/null
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 2DDF0429E3A\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Nov 2014 22:52:29 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id QFs5AWnutDkE for <notmuch@notmuchmail.org>;\r
+ Mon, 3 Nov 2014 22:52:22 -0800 (PST)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 110CD431FC4\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Nov 2014 22:52:22 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1XlXyX-0001jt-3y; Tue, 04 Nov 2014 02:52:21 -0400\r
+Received: (nullmailer pid 26307 invoked by uid 1000); Tue, 04 Nov 2014\r
+ 06:52:15 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 06/10] cli: Introduce "notmuch address" command\r
+In-Reply-To: <1415058622-21162-7-git-send-email-sojkam1@fel.cvut.cz>\r
+References: <1415058622-21162-1-git-send-email-sojkam1@fel.cvut.cz>\r
+ <1415058622-21162-7-git-send-email-sojkam1@fel.cvut.cz>\r
+User-Agent: Notmuch/0.18.2+156~g3cc8ed5 (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 04 Nov 2014 07:52:15 +0100\r
+Message-ID: <87d293mp9c.fsf@maritornes.cs.unb.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 04 Nov 2014 06:52:29 -0000\r
+\r
+Michal Sojka <sojkam1@fel.cvut.cz> writes:\r
+\r
+> +{\r
+> + local cur prev words cword split\r
+> + _init_completion -s || return\r
+> +\r
+> + $split &&\r
+> + case "${prev}" in\r
+> + --format)\r
+> + COMPREPLY=( $( compgen -W "json sexp text text0" -- "${cur}" ) )\r
+> + return\r
+> + ;;\r
+> + --output)\r
+> + COMPREPLY=( $( compgen -W "sender recipients" -- "${cur}" ) )\r
+> + return\r
+> + ;;\r
+> + --sort)\r
+> + COMPREPLY=( $( compgen -W "newest-first oldest-first" -- "${cur}" ) )\r
+> + return\r
+> + ;;\r
+> + --exclude)\r
+> + COMPREPLY=( $( compgen -W "true false flag all" -- "${cur}" ) )\r
+> + return\r
+> + ;;\r
+> + esac\r
+> +\r
+> + ! $split &&\r
+> + case "${cur}" in\r
+> + -*)\r
+> + local options="--format= --output= --sort= --exclude="\r
+> + compopt -o nospace\r
+> + COMPREPLY=( $(compgen -W "$options" -- ${cur}) )\r
+> + ;;\r
+> + *)\r
+> + _notmuch_search_terms\r
+> + ;;\r
+> + esac\r
+> +}\r
+> +\r
+\r
+I am reminded that we have no tests for shell completion stuff, which\r
+seems pretty fragile.\r
+\r
+> +\r
+> + ``--format=``\ (**json**\ \|\ **sexp**\ \|\ **text**\ \|\ **text0**)\r
+> + Presents the results in either JSON, S-Expressions, newline\r
+> + character separated plain-text (default), or null character\r
+> + separated plain-text (compatible with **xargs(1)** -0 option\r
+> + where available).\r
+> +\r
+> + ``--format-version=N``\r
+> + Use the specified structured output format version. This is\r
+> + intended for programs that invoke **notmuch(1)** internally. If\r
+> + omitted, the latest supported version will be used.\r
+> +\r
+\r
+\r
+I wonder if at some point we should have a notmuch-output-formats.7 page.\r
+\r
+\r
+> + ``--exclude=(true|false|all|flag)``\r
+> + A message is called "excluded" if it matches at least one tag in\r
+> + search.tag\_exclude that does not appear explicitly in the\r
+> + search terms. This option specifies whether to omit excluded\r
+> + messages in the search process.\r
+\r
+Similarly for excludes. I'm ok with the duplication for now, and I can\r
+see an argument for not making the user chase references.\r
+\r