mshow: add "-A all" to render all attachments

Closes #198.
pull/201/head
Leah Neukirchen 3 years ago
parent 8e0d57425f
commit 318ac214f1

@ -346,7 +346,7 @@ _mshow() {
- regular \ - regular \
'-n[only print message numbers]' \ '-n[only print message numbers]' \
'-h[display only given headers]:header list:_mblaze_colon_separated_headers' \ '-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]' \ '-n[don'\''t update current message link]' \
'(-r)-q[print only header]' \ '(-r)-q[print only header]' \
'(-q)-r[print body raw]' \ '(-q)-r[print body raw]' \

@ -1,4 +1,4 @@
.Dd August 24, 2018 .Dd January 17, 2021
.Dt MSHOW 1 .Dt MSHOW 1
.Os .Os
.Sh NAME .Sh NAME
@ -47,17 +47,26 @@ instead of the default headers
.Sq Li from\&:subject\&:to\&:cc\&:date\&:reply\&-to\&: . .Sq Li from\&:subject\&:to\&:cc\&:date\&:reply\&-to\&: .
.It Fl A Ar mimetypes .It Fl A Ar mimetypes
Define Define
.Sq Li "mixed/alternative" .Sq Li "multipart/alternative"
preference. preference.
.Ar mimetypes .Ar mimetypes
is a colon-separated list of is a colon-separated list of
MIME types which will be preferred, MIME types which will be preferred,
in the order given, in the order given,
when rendering when rendering
.Sq Li "mixed/alternative" .Sq Li "multipart/alternative"
parts. parts.
If no MIME type matches, the first MIME part will be rendered. If no MIME type matches, the first MIME part will be rendered.
.Pp .Pp
When
.Ar mimetypes
is
.Sq Li all ,
.Nm
will render all parts of a
.Sq Li "multipart/alternative"
part.
.Pp
Defaults to Defaults to
.Sq Li "text/plain:text/html" . .Sq Li "text/plain:text/html" .
.It Fl n .It Fl n

@ -316,9 +316,10 @@ nofilter:
} }
printf("\n"); printf("\n");
} else if (strncmp(ct, "multipart/alternative", 21) == 0) { } else if (strncmp(ct, "multipart/alternative", 21) == 0) {
choose_alternative(msg, depth); if (strcmp(Aflag, "all") != 0) {
choose_alternative(msg, depth);
r = MIME_PRUNE; r = MIME_PRUNE;
} // else default blaze822_mime_walk action
} else if (strncmp(ct, "multipart/", 10) == 0) { } else if (strncmp(ct, "multipart/", 10) == 0) {
; // default blaze822_mime_walk action ; // default blaze822_mime_walk action
} else { } else {

Loading…
Cancel
Save