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

Jani Nikula jani at nikula.org
Wed Dec 20 03:15:06 PST 2017


On Tue, 19 Dec 2017, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
> On Wed, Dec 20 2017, Jani Nikula <jani at nikula.org> wrote:
>> ~$ 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.
>
> Really?  If each is just a switch then why not:
>
> ~$ notmuch address --sender --recipients --address --count id:878tdy8a2q.fsf at ligo.caltech.edu
>
> ?  It's just shorter, right?
>
> Also, this behavior is quite different than for search, in which only
> the last --output applies.
>
>> notmuch search uses separate --entire-thread, --body, and --include-html
>> options, and I think those are getting messy.

That was supposed to be notmuch show, not search.

> The seem less messy than a "--output=" prefixed version of the same.

Matter of taste. I like the self-documenting aspect of *what* these
options control. --output=body is obvious, --body is less
so. --include-html includes html somewhere, I think --output=html would
be better.

In the spirit of worse is better, I'll note that using --output= stores
all the possible values in a single bit mask, and it's easy to define
the defaults for *all* possible outputs in one variable, and it's easy
to check *all* possible combinations with bit masks. Not so with
independent parameters. Again, matter of taste how much you appreciate
implementation simplicity. With notmuch show, I think that guideline
would have made the interface better too. YMMV.

As to notmuch address --output=address, it fulfills all the feature
needs that popped up in this thread. If there's a strong desired to
change the interface, we'll need patches as this one's already merged.

BR,
Jani.


More information about the notmuch mailing list