diff options
| author | Jani Nikula <jani@nikula.org> | 2017-11-02 20:44:59 +0200 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2017-12-14 21:28:50 -0400 |
| commit | f3fc97c0008c1d48ccac88c52b5bae61460bfa3f (patch) | |
| tree | d9db0e79e02c2d03f2cbd4cfe5c90fcc218b7759 /test/T095-address.sh | |
| parent | ab4b033c70eab04c7080aacfbcd362548214340a (diff) | |
cli: add support for only printing the addresses in notmuch address
The notmuch address output is much more useful for scripts with just
the addresses printed. Support this using the --output=address option.
Diffstat (limited to 'test/T095-address.sh')
| -rwxr-xr-x | test/T095-address.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/T095-address.sh b/test/T095-address.sh index f0291d29..817be538 100755 --- a/test/T095-address.sh +++ b/test/T095-address.sh @@ -119,6 +119,42 @@ cat <<EOF >EXPECTED EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "--output=recipients --output=address" +notmuch address --output=recipients --output=address '*' >OUTPUT +cat <<EOF >EXPECTED +allan@archlinux.org +aur-general@archlinux.org +olivier.berger@it-sudparis.eu +notmuch@notmuchmail.org +notmuch@notmuchmail.org +keithp@keithp.com +dottedmag@dottedmag.net +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=sender --output=address --output=count" +notmuch address --output=sender --output=address --output=count '*' | sort -n >OUTPUT +cat <<EOF >EXPECTED +1 agriffis@n01se.net +1 aperez@igalia.com +1 boulogne.f@gmail.com +1 chris@chris-wilson.co.uk +1 ingmar@exherbo.org +1 isra@herraiz.org +1 olivier.berger@it-sudparis.eu +1 rollandsantimano@yahoo.com +2 alex.boterolowry@gmail.com +2 gzjjgod@gmail.com +3 stewart@flamingspork.com +4 alex.boterolowry@gmail.com +4 jan@ryngle.com +5 dottedmag@dottedmag.net +5 lars@seas.harvard.edu +7 keithp@keithp.com +12 cworth@cworth.org +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest "--output=count --format=json" # Since the iteration order of GHashTable is not specified, we # preprocess and sort the results to keep the order stable here. |
