summarize: print subject when summarizing.
This commit is contained in:
parent
2f62ec53d6
commit
4ab9416c8d
@ -2,7 +2,7 @@ use std::fs::File;
|
||||
|
||||
use clap::Parser;
|
||||
use email::fingerprint;
|
||||
use mailparse::parse_mail;
|
||||
use mailparse::{parse_mail, MailHeaderMap};
|
||||
use memmap::MmapOptions;
|
||||
|
||||
/// Use library to summarize information about given mail files
|
||||
@ -19,7 +19,11 @@ fn main() -> anyhow::Result<()> {
|
||||
let file = File::open(&path)?;
|
||||
let mmap = unsafe { MmapOptions::new().map(&file)? };
|
||||
let m = parse_mail(&mmap)?;
|
||||
println!("{path}\n{}", fingerprint(&m).join("\n"));
|
||||
let subject = m
|
||||
.headers
|
||||
.get_first_value("subject")
|
||||
.unwrap_or("(NO SUBJECT)".to_owned());
|
||||
println!("{subject}: {path}\n{}", fingerprint(&m).join("\n"));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user