Restore backup flag as error message only

This commit is contained in:
Andrew 2023-09-26 10:54:01 +13:00
parent 04a6f8df2b
commit fa9bddb19e

View file

@ -56,6 +56,14 @@ fn main() {
.value_name("level")
.value_parser(["0", "1", "2", "3", "4", "5", "6", "max"]),
)
.arg(
Arg::new("backup")
.help("Back up modified files")
.short('b')
.long("backup")
.hide(true)
.action(ArgAction::SetTrue),
)
.arg(
Arg::new("recursive")
.help("Recurse into subdirectories and optimize all *.png/*.apng files")
@ -285,6 +293,11 @@ Heuristic filter selection strategies:
)
.get_matches_from(std::env::args());
if matches.get_flag("backup") {
eprintln!("The --backup flag is no longer supported. Please use --out or --dir to preserve your existing files.");
exit(1)
}
let (out_file, out_dir, opts) = match parse_opts_into_struct(&matches) {
Ok(x) => x,
Err(x) => {