aboutsummaryrefslogtreecommitdiff
path: root/notmuch.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-29 14:07:45 -0700
committerCarl Worth <cworth@cworth.org>2009-10-29 14:07:45 -0700
commit8b93875b2705caa10d33e6fc71ebce6f41fdd79b (patch)
tree74da6a442c28df423656fc0b2592322fd915c44a /notmuch.c
parent90a0ef4ac4a023f11f82b037c635b4b22762b12f (diff)
notmuch show: Trim down header list.
This is for now a non-configurable list of Subject, From, To, Cc, Bcc, and Date.
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/notmuch.c b/notmuch.c
index f47e4fc..4ac5531 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -811,6 +811,12 @@ show_command (unused (int argc), unused (char *argv[]))
int ret = 0;
int c;
+ const char *headers[] = {
+ "Subject", "From", "To", "Cc", "Bcc", "Date"
+ };
+ const char *name, *value;
+ unsigned int i;
+
if (argc != 1) {
fprintf (stderr, "Error: \"notmuch show\" requires exactly one thread-ID argument.\n");
ret = 1;
@@ -847,7 +853,12 @@ show_command (unused (int argc), unused (char *argv[]))
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");