Change pretend to dry-run

This commit is contained in:
Andrew 2025-08-04 17:27:58 +12:00
parent eef5633786
commit fafe3707be
3 changed files with 5 additions and 5 deletions

View file

@ -97,10 +97,10 @@ Note that this will not preserve the directory structure of the input files when
.action(ArgAction::SetTrue), .action(ArgAction::SetTrue),
) )
.arg( .arg(
Arg::new("pretend") Arg::new("dry-run")
.help("Do not write any files, only show compression results") .help("Do not write any files, only show compression results")
.short('P') .short('d')
.long("pretend") .long("dry-run")
.action(ArgAction::SetTrue), .action(ArgAction::SetTrue),
) )
.arg( .arg(

View file

@ -263,7 +263,7 @@ pub fn optimize(input: &InFile, output: &OutFile, opts: &Options) -> PngResult<(
match (output, input) { match (output, input) {
(OutFile::None, _) => { (OutFile::None, _) => {
info!("{savings}: Running in pretend mode, no output"); info!("{savings}: Dry run, no output");
} }
(&OutFile::StdOut, _) | (&OutFile::Path { path: None, .. }, &InFile::StdIn) => { (&OutFile::StdOut, _) | (&OutFile::Path { path: None, .. }, &InFile::StdIn) => {
let mut buffer = BufWriter::new(stdout()); let mut buffer = BufWriter::new(stdout());

View file

@ -233,7 +233,7 @@ fn parse_opts_into_struct(
None None
}; };
let out_file = if matches.get_flag("pretend") { let out_file = if matches.get_flag("dry-run") {
OutFile::None OutFile::None
} else if matches.get_flag("stdout") { } else if matches.get_flag("stdout") {
OutFile::StdOut OutFile::StdOut