[PATCH] cli: add support for only printing the addresses in notmuch address

Jani Nikula jani at nikula.org
Tue Dec 19 23:02:01 PST 2017


On Tue, 19 Dec 2017, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
> On Tue, Dec 19 2017, Daniel Kahn Gillmor <dkg at fifthhorseman.net> wrote:
>> On Tue 2017-12-19 13:23:55 -0800, Jameson Graef Rollins wrote:
>>> On Thu, Nov 02 2017, Jani Nikula <jani at nikula.org> wrote:
>>>> The notmuch address output is much more useful for scripts with just
>>>> the addresses printed. Support this using the --output=address option.
>>>
>>> Isn't "address" kind of orthogonal to "sender" and "recipient"?  Isn't
>>> this more like the --output/--format distinction in search?
>>
>> i think i agree with Jamie here -- it'd be nice to be able to ask for
>> the addresses of the senders, or the addresses of the recipients.  how
>> would that be done here?
>
> Sorry, I see now that address already has the --format option with the
> expected values.  So I think either address-only or sender/recipient
> should be a separate option.

Note that you can give the notmuch address --output option multiple
times to control the output. For example,

~$ notmuch address --output=sender --output=recipients id:878tdy8a2q.fsf at ligo.caltech.edu
Jameson Graef Rollins <jrollins at finestructure.net>
Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Jani Nikula <jani at nikula.org>
notmuch at notmuchmail.org

~$ notmuch address --output=recipients --output=address id:878tdy8a2q.fsf at ligo.caltech.edu
dkg at fifthhorseman.net
jani at nikula.org
notmuch at notmuchmail.org

~$ notmuch address --output=sender --output=recipients --output=address --output=count id:878tdy8a2q.fsf at ligo.caltech.edu
1	notmuch at notmuchmail.org
1	jrollins at finestructure.net
1	dkg at fifthhorseman.net
1	jani at nikula.org

I prefer this to separate options.

notmuch search uses separate --entire-thread, --body, and --include-html
options, and I think those are getting messy.

BR,
Jani.


More information about the notmuch mailing list