about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-01-17 23:09:55 +0100
committerLeah Neukirchen <leah@vuxu.org>2021-01-17 23:09:55 +0100
commit318ac214f1de06b0ee69106a36368b2d3b2ac902 (patch)
tree23ccf6aca7f0aca2811ea444b5379db82991659e
parent8e0d57425f7f0605ae35894eea25e200e88b330f (diff)
downloadmblaze-318ac214f1de06b0ee69106a36368b2d3b2ac902.tar.gz
mblaze-318ac214f1de06b0ee69106a36368b2d3b2ac902.tar.xz
mblaze-318ac214f1de06b0ee69106a36368b2d3b2ac902.zip
mshow: add "-A all" to render all attachments
Closes #198.
-rw-r--r--contrib/_mblaze2
-rw-r--r--man/mshow.115
-rw-r--r--mshow.c7
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 {