diff --git a/src/main.rs b/src/main.rs index d1b45465..12abcbbb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -225,7 +225,7 @@ fn main() { ) .arg( Arg::new("no-reductions") - .help("No reductions") + .help("No reductions or deinterlacing") .long("nx") .action(ArgAction::SetTrue), ) @@ -431,14 +431,6 @@ fn parse_opts_into_struct( Some(level) => Options::from_preset(level.parse::().unwrap()), }; - if let Some(x) = matches.get_one::("interlace") { - opts.interlace = if x == "keep" { - None - } else { - x.parse::().unwrap().try_into().ok() - }; - } - if let Some(x) = matches.get_one::>("filters") { opts.filter.clear(); for &f in x { @@ -507,10 +499,19 @@ fn parse_opts_into_struct( opts.color_type_reduction = false; opts.palette_reduction = false; opts.grayscale_reduction = false; + opts.interlace = None; } opts.idat_recoding = !matches.get_flag("no-recoding"); + if let Some(x) = matches.get_one::("interlace") { + opts.interlace = if x == "keep" { + None + } else { + x.parse::().unwrap().try_into().ok() + }; + } + if let Some(keep) = matches.get_one::("keep") { let names = keep .split(',')