aboutsummaryrefslogtreecommitdiff
path: root/notmuch-show.c
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-10-31 10:54:31 +1100
committerDavid Bremner <david@tethera.net>2018-11-24 09:11:42 -0400
commit37e5bc00aeb9123dd88367b7506a19f74877dfe4 (patch)
tree548f822d874c1693d94787420d0e9260a2af7748 /notmuch-show.c
parent7f726c6e87517eb9c84119a1c5e3a63bfaaa49f6 (diff)
cli: notmuch show support for --body=false with --format=text
Diffstat (limited to 'notmuch-show.c')
-rw-r--r--notmuch-show.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/notmuch-show.c b/notmuch-show.c
index c3a3783a..42fe27cc 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -574,6 +574,11 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node,
g_mime_stream_printf (stream, "Date: %s\n", date_string);
g_mime_stream_printf (stream, "\fheader}\n");
+ if (!params->output_body)
+ {
+ g_mime_stream_printf (stream, "\f%s}\n", part_type);
+ return NOTMUCH_STATUS_SUCCESS;
+ }
g_mime_stream_printf (stream, "\fbody{\n");
}
@@ -1204,9 +1209,11 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])
fprintf (stderr, "Warning: --body=false is incompatible with --part > 0. Disabling.\n");
params.output_body = true;
} else {
- if (format != NOTMUCH_FORMAT_JSON && format != NOTMUCH_FORMAT_SEXP)
+ if (format != NOTMUCH_FORMAT_TEXT &&
+ format != NOTMUCH_FORMAT_JSON &&
+ format != NOTMUCH_FORMAT_SEXP)
fprintf (stderr,
- "Warning: --body=false only implemented for format=json and format=sexp\n");
+ "Warning: --body=false only implemented for format=text, format=json and format=sexp\n");
}
}