Restore backup flag as error message only
This commit is contained in:
parent
04a6f8df2b
commit
fa9bddb19e
1 changed files with 13 additions and 0 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue