[PATCH 2/3] cli: show allow the caller to specify the headers output.

Mark Walters markwalters1009 at gmail.com
Fri Jul 13 12:50:29 PDT 2012


On Fri, 13 Jul 2012, Jameson Graef Rollins <jrollins at finestructure.net> wrote:
> On Sat, Jul 07 2012, Mark Walters <markwalters1009 at gmail.com> wrote:
>> +typedef enum {
>> +    NOTMUCH_SHOW_OUTPUT_HDR_DATE = 0x1,
>> +    NOTMUCH_SHOW_OUTPUT_HDR_SUBJECT = 0x2,
>> +    NOTMUCH_SHOW_OUTPUT_HDR_FROM = 0x4,
>> +    NOTMUCH_SHOW_OUTPUT_HDR_TO = 0x8,
>> +    NOTMUCH_SHOW_OUTPUT_HDR_CC = 0x10,
>> +    NOTMUCH_SHOW_OUTPUT_HDR_REPLY_TO = 0x20,
>> +    NOTMUCH_SHOW_OUTPUT_HDR_IN_REPLY_TO = 0x40,
>> +    NOTMUCH_SHOW_OUTPUT_HDR_REFERENCES = 0x80,
>> +    NOTMUCH_SHOW_OUTPUT_DEFAULT =
>> +	    NOTMUCH_SHOW_OUTPUT_HDR_SUBJECT |
>> +	    NOTMUCH_SHOW_OUTPUT_HDR_FROM |
>> +	    NOTMUCH_SHOW_OUTPUT_HDR_TO |
>> +	    NOTMUCH_SHOW_OUTPUT_HDR_CC |
>> +	    NOTMUCH_SHOW_OUTPUT_HDR_DATE
>> +} notmuch_show_output_t;
>
> Is there a reason we need to limit this to some pre-defined subset of
> headers?  Wouldn't it be nice if you could just specify arbitrary
> headers?

I basically agree but it looked like it would be relatively ugly to pass
around. 

However, perhaps this is all being too general: the caller probably
cares that all the headers it wants are output and perhaps not too many
others (eg over ssh or to android etc). Would something more like
headers=brief or headers=full be enough? And we would still want an
option allowing the body to be omitted.

What do you think?

Best wishes

Mark



More information about the notmuch mailing list