From d36695178c20eb06e851da6a146e6277376e7ab9 Mon Sep 17 00:00:00 2001 From: electricboogie <32370782+kimono-koans@users.noreply.github.com> Date: Wed, 31 May 2023 06:18:50 -0500 Subject: [PATCH] Clarify errors --- src/config.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 968a24f..27be45b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -399,7 +399,7 @@ impl Config { return true; } - eprintln!("Error: Path is not a file: {:?}", path); + eprintln!("Error: Path is not a regular file: {:?}", path); false }) .filter(|path| { @@ -410,7 +410,14 @@ impl Config { eprintln!("Error: Path cannot be serialized to string: {:?}", path); false }) - .filter(|path| path.file_name() != Some(OsStr::new(hash_file))) + .filter(|path| { + if path.file_name() == Some(OsStr::new(hash_file)) { + eprintln!("Error: File name is the name of a dano hash file: {:?}", path); + return false + } + + true + }) .filter_map(|path| { if !opt_disable_filter { let opt_extension = path.extension(); @@ -444,7 +451,7 @@ impl Config { buffer.push_str(" "); }); - eprintln!("WARNING: The following are extensions which are unknown to dano: {:?}. dano has excluded all files with these extensions. If you know this file type is acceptable to ffmpeg, you may use --disable-filter to force dano to accept its use.", buffer.trim()); + eprintln!("WARNING: The following are extensions which are unknown to dano: {:?}. dano has excluded all files with these extensions. If you know these file types are acceptable to ffmpeg, you may use --disable-filter to force dano to accept their use.", buffer.trim()); } valid_paths.iter().map(|path| {