diff --git a/src/main.rs b/src/main.rs index 858ee17..68b9c05 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,7 +41,7 @@ fn process_compressed_files(path: &Path) -> io::Result<()> { process_compressed_files(&entry_path)?; } else if let Some(ext) = entry_path.extension().and_then(|e| e.to_str()) { if ext == "rar" || ext == "zip" { - return unar_file(&entry_path); + unar_file(&entry_path).expect("UNAR Error."); } } } @@ -58,6 +58,10 @@ fn main() -> io::Result<()> { PathBuf::from(".") }; + if start_path.is_file() { + return unar_file(&start_path); + } + process_compressed_files(&start_path)?; Ok(())