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 E923A431FAE for ; Mon, 22 Sep 2014 02:39:48 -0700 (PDT) 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 yngT4UwdKOQv for ; Mon, 22 Sep 2014 02:39:42 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 8C50F431FC3 for ; Mon, 22 Sep 2014 02:39:29 -0700 (PDT) Received: from localhost (unknown [192.168.200.7]) by max.feld.cvut.cz (Postfix) with ESMTP id 3C5793CFEA9; Mon, 22 Sep 2014 11:39:26 +0200 (CEST) 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 4FBJj1k1da1M; Mon, 22 Sep 2014 11:39:22 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 6A7B05CCE62; Mon, 22 Sep 2014 11:39:22 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.84) (envelope-from ) id 1XW05U-0001w0-Il; Mon, 22 Sep 2014 11:39:16 +0200 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH 0/5] notmuch search --output=addresses Date: Mon, 22 Sep 2014 11:37:54 +0200 Message-Id: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 2.1.0 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: Mon, 22 Sep 2014 09:39:49 -0000 Hello all, this patch series adds support for --output=addresses and similar arguments in notmuch search. It is a reworked and extended version of id:1410021689-15901-1-git-send-email-jani@nikula.org. Compared to Jani's patches, I do not use keyword-flag command line parser for the --output option, because this would not be useful for most but one combination of keywords. Instead, this one combination is explicitely mentioned as another keyword. The flag command-line parser is introduced later, with (IMHO) better syntax: --flags=one,two,... This feature is used to control address deduplication via the --unique option. Other extensions are added documentation, tests and shell completions. The whole test suite passes with these patches. The functionality presented here will be useful for improving Emacs address completion (id:1411150602-21892-1-git-send-email-sojkam1@fel.cvut.cz). Another nice use case is sending patched with git: git send-email --cc-cmd='nmsenders id:xxxx' ... where nmsenders script contains: notmuch search --output=sender $(notmuch search --output=threads $1) Michal Sojka (5): cli: Refactor option passing in the search command cli: Extend the search command for --output=addresses and similar cli: Add support for parsing command line "flag" options cli: Add configurable address deduplication for --output=addresses cli: Add tests for 'search --output=addresses' and similar command-line-arguments.c | 40 +++++ command-line-arguments.h | 1 + completion/notmuch-completion.bash | 8 +- completion/notmuch-completion.zsh | 4 +- doc/man1/notmuch-search.rst | 55 ++++++- notmuch-search.c | 311 +++++++++++++++++++++++++++++-------- test/Makefile.local | 2 +- test/T090-search-output.sh | 59 +++++++ test/T095-search-unique.sh | 63 ++++++++ test/T410-argument-parsing.sh | 3 +- test/arg-test.c | 8 + 11 files changed, 482 insertions(+), 72 deletions(-) create mode 100755 test/T095-search-unique.sh -- 2.1.0