Add help notes on keep display

This commit is contained in:
Andrew 2023-11-30 16:58:02 +13:00
parent 16b04cd688
commit d7f9c81a28

View file

@ -175,6 +175,12 @@ depth is changed, regardless of any options set.",
.arg( .arg(
Arg::new("keep") Arg::new("keep")
.help("Strip all metadata except in the comma-separated list") .help("Strip all metadata except in the comma-separated list")
.long_help("\
Strip all metadata chunks except those in the comma-separated list. The special value \
'display' includes chunks that affect the image appearance, equivalent to '--strip safe'.
E.g. '--keep eXIf,display' will strip chunks, keeping only eXIf and those that affect the \
image appearance.")
.long("keep") .long("keep")
.value_name("list") .value_name("list")
.conflicts_with("strip") .conflicts_with("strip")
@ -617,12 +623,12 @@ fn parse_opts_into_struct(
let mut keep_display = false; let mut keep_display = false;
let mut names = keep let mut names = keep
.split(',') .split(',')
.filter_map(|x| { .filter_map(|name| {
if x == "display" { if name == "display" {
keep_display = true; keep_display = true;
return None; return None;
} }
Some(parse_chunk_name(x)) Some(parse_chunk_name(name))
}) })
.collect::<Result<IndexSet<_>, _>>()?; .collect::<Result<IndexSet<_>, _>>()?;
if keep_display { if keep_display {