diff --git a/mless b/mless index c4bdc53..2feaf03 100755 --- a/mless +++ b/mless @@ -9,9 +9,15 @@ function fg(c, s) { return sprintf("\033[38;5;%03dm%s\033[0m", c, s) } function so(s) { return sprintf("\033[1m%s\033[0m", s) } BEGIN { hdr = 1 } /^$/ { hdr = 0 } +/^-- $/ { ftr = 1 } +/^--- .* ---/ { print fg(242, $0); ftr = 0; sig = 0; next } +/^-----BEGIN .* SIGNATURE-----/ { sig = 1 } hdr && /^From:/ { print so(fg(119, $0)); next } hdr { print fg(120, $0); next } -/^--- .* ---/ { print fg(242, $0); next } +ftr { print fg(244, $0); next } +/^-----BEGIN .* MESSAGE-----/ || +/^-----END .* SIGNATURE-----/ { print fg(244, $0); sig = 0; next } +sig { print fg(244, $0); next } /^>/ { print fg(151, $0); next } { print }' }