crabmail

Static HTML email archive viewer in Rust
git clone git://git.alexwennerberg.com/crabmail
Log | Files | Refs | README | LICENSE

commit 33096a1615a64426ef54e36e9e27d15d2e7669e4
parent 00f772bc5960beed993865c0d80ca0ccd7be8e45
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Mon, 10 Jan 2022 09:22:49 -0800

Improve stdout

Diffstat:
Msrc/main.rs | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs @@ -542,6 +542,7 @@ fn main() -> Result<()> { let css = include_bytes!("style.css"); let mut names = vec![]; + let mut message_count = 0; for maildir in std::fs::read_dir(&args.maildir).unwrap() { let maildir = maildir?; let dirreader = Maildir::from(maildir.path().to_str().unwrap()); @@ -575,10 +576,11 @@ fn main() -> Result<()> { let email = match local_parse_email(&buffer) { Ok(e) => e, Err(e) => { - println!("Error parsing {:?} -- {:?}", tmp.path(), e); + eprintln!("Error parsing {:?} -- {:?}", tmp.path(), e); continue; } }; + message_count += 1; // write raw emails if Config::global().include_raw { // inefficient here -- no diff @@ -704,6 +706,7 @@ fn main() -> Result<()> { let mut css_root = File::create(Config::global().out_dir.join("style.css"))?; css_root.write(css)?; write_index(names)?; + eprintln!("Processed {} emails", message_count); Ok(()) }