From d594efee093368a953e02a293503a7e1b8e52a56 Mon Sep 17 00:00:00 2001 From: LuckyTurtleDev Date: Fri, 22 Sep 2023 19:30:10 +0200 Subject: [PATCH] allow explicitly specify files --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index ae2c7483..57b490d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -363,10 +363,10 @@ fn collect_files( out_file: &OutFile, recursive: bool, include_non_png: bool, - allow_stdin: bool, + top_level: bool, //explicitly specify files ) -> Vec<(InFile, OutFile)> { let mut in_out_pairs = Vec::new(); - let allow_stdin = allow_stdin && files.len() == 1; + let allow_stdin = top_level && files.len() == 1; for input in files { let using_stdin = allow_stdin && input.to_str().map_or(false, |p| p == "-"); if !using_stdin && input.is_dir() { @@ -403,7 +403,7 @@ fn collect_files( } else { //skip non png files if recusive flag is used. //(still allow the user to convert a non png file if recusive flag is not used); - if recursive && !include_non_png && { + if !top_level && recursive && !include_non_png && { let extension = input.extension().map(|f| f.to_ascii_lowercase()); extension != Some(OsString::from("png")) && extension != Some(OsString::from("apng"))