From 318ac214f1de06b0ee69106a36368b2d3b2ac902 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Sun, 17 Jan 2021 23:09:55 +0100 Subject: mshow: add "-A all" to render all attachments Closes #198. --- contrib/_mblaze | 2 +- man/mshow.1 | 15 ++++++++++++--- mshow.c | 7 ++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/contrib/_mblaze b/contrib/_mblaze index 5255629..3d689a5 100644 --- a/contrib/_mblaze +++ b/contrib/_mblaze @@ -346,7 +346,7 @@ _mshow() { - regular \ '-n[only print message numbers]' \ '-h[display only given headers]:header list:_mblaze_colon_separated_headers' \ - '-A[mixed/alternative preference]:mime type: ' \ + '-A[multipart/alternative preference]:mime type: ' \ '-n[don'\''t update current message link]' \ '(-r)-q[print only header]' \ '(-q)-r[print body raw]' \ diff --git a/man/mshow.1 b/man/mshow.1 index b8e2ca7..9126787 100644 --- a/man/mshow.1 +++ b/man/mshow.1 @@ -1,4 +1,4 @@ -.Dd August 24, 2018 +.Dd January 17, 2021 .Dt MSHOW 1 .Os .Sh NAME @@ -47,17 +47,26 @@ instead of the default headers .Sq Li from\&:subject\&:to\&:cc\&:date\&:reply\&-to\&: . .It Fl A Ar mimetypes Define -.Sq Li "mixed/alternative" +.Sq Li "multipart/alternative" preference. .Ar mimetypes is a colon-separated list of MIME types which will be preferred, in the order given, when rendering -.Sq Li "mixed/alternative" +.Sq Li "multipart/alternative" parts. If no MIME type matches, the first MIME part will be rendered. .Pp +When +.Ar mimetypes +is +.Sq Li all , +.Nm +will render all parts of a +.Sq Li "multipart/alternative" +part. +.Pp Defaults to .Sq Li "text/plain:text/html" . .It Fl n diff --git a/mshow.c b/mshow.c index 8d70120..f66e7b2 100644 --- a/mshow.c +++ b/mshow.c @@ -316,9 +316,10 @@ nofilter: } printf("\n"); } else if (strncmp(ct, "multipart/alternative", 21) == 0) { - choose_alternative(msg, depth); - - r = MIME_PRUNE; + if (strcmp(Aflag, "all") != 0) { + choose_alternative(msg, depth); + r = MIME_PRUNE; + } // else default blaze822_mime_walk action } else if (strncmp(ct, "multipart/", 10) == 0) { ; // default blaze822_mime_walk action } else { -- cgit 1.4.1