summarize: add flag for including content-type parameters

This commit is contained in:
Bill Thiede 2023-12-02 12:48:52 -08:00
parent 34293e03d2
commit d78852976f

View File

@ -9,6 +9,10 @@ use memmap::MmapOptions;
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
/// Include subpart params in fingerprint
#[arg(short, long)]
include_params: bool,
/// List of files to summarize
paths: Vec<String>,
}
@ -23,7 +27,10 @@ fn main() -> anyhow::Result<()> {
.headers
.get_first_value("subject")
.unwrap_or("(NO SUBJECT)".to_owned());
println!("{subject}: {path}\n{}", fingerprint(&m, false).join("\n"));
println!(
"{subject}: {path}\n{}",
fingerprint(&m, args.include_params).join("\n")
);
}
Ok(())
}