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-j...@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-sojk...@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

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to