X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-show.c;h=07e9a5dbc8169e3618cea09bc1a7da8389b0040f;hp=c3a3783a4094c952f61b567907b87f658a1381ab;hb=0557c5a0333b971188c02c961dec88496f2eed0c;hpb=c3a683299d4c27d6eadaacf4fb516f73a6c69fc3 diff --git a/notmuch-show.c b/notmuch-show.c index c3a3783a..07e9a5db 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -574,12 +574,18 @@ 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"); } if (leaf) { if (g_mime_content_type_is_type (content_type, "text", "*") && - !g_mime_content_type_is_type (content_type, "text", "html")) + (params->include_html || + ! g_mime_content_type_is_type (content_type, "text", "html"))) { show_text_part_content (node->part, stream, 0); } else { @@ -1204,15 +1210,19 @@ 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"); } } if (params.include_html && - (format != NOTMUCH_FORMAT_JSON && format != NOTMUCH_FORMAT_SEXP)) { - fprintf (stderr, "Warning: --include-html only implemented for format=json and format=sexp\n"); + (format != NOTMUCH_FORMAT_TEXT && + format != NOTMUCH_FORMAT_JSON && + format != NOTMUCH_FORMAT_SEXP)) { + fprintf (stderr, "Warning: --include-html only implemented for format=text, format=json and format=sexp\n"); } query_string = query_string_from_args (config, argc-opt_index, argv+opt_index);