notmuch show: Trim down header list.

This is for now a non-configurable list of Subject, From, To, Cc,
Bcc, and Date.
This commit is contained in:
Carl Worth 2009-10-29 14:07:45 -07:00
parent 90a0ef4ac4
commit 8b93875b27

View file

@ -811,6 +811,12 @@ show_command (unused (int argc), unused (char *argv[]))
int ret = 0; int ret = 0;
int c; int c;
const char *headers[] = {
"Subject", "From", "To", "Cc", "Bcc", "Date"
};
const char *name, *value;
unsigned int i;
if (argc != 1) { if (argc != 1) {
fprintf (stderr, "Error: \"notmuch show\" requires exactly one thread-ID argument.\n"); fprintf (stderr, "Error: \"notmuch show\" requires exactly one thread-ID argument.\n");
ret = 1; ret = 1;
@ -847,7 +853,12 @@ show_command (unused (int argc), unused (char *argv[]))
printf ("%%header{\n"); printf ("%%header{\n");
printf ("%s", notmuch_message_get_all_headers (message)); for (i = 0; i < ARRAY_SIZE (headers); i++) {
name = headers[i];
value = notmuch_message_get_header (message, name);
if (value)
printf ("%s: %s\n", name, value);
}
printf ("%%header}\n"); printf ("%%header}\n");