From af60356f79a8f459977754690648ce225b55b8d5 Mon Sep 17 00:00:00 2001 From: Arcterus Date: Fri, 28 Feb 2014 13:35:21 -0800 Subject: [PATCH] mkdir: improve error handling (closes #121) --- mkdir/mkdir.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkdir/mkdir.rs b/mkdir/mkdir.rs index 80ade2501..c1b9c4801 100644 --- a/mkdir/mkdir.rs +++ b/mkdir/mkdir.rs @@ -126,14 +126,14 @@ fn exec(dirs: ~[~str], mk_parents: bool, mode: u32, verbose: bool) { if parent_exists && !path.exists() { mkdir(&path, mode); if verbose {println!("{}", *dir);} - } else { + } else if !mk_parents { let mut error_msg = ~""; if !parent_exists { - error_msg.push_str("Error: parent directory '"); + error_msg.push_str("parent directory '"); error_msg.push_str(parent); error_msg.push_str("' does not exist"); } else { - error_msg.push_str("Error: directory '"); + error_msg.push_str("directory '"); error_msg.push_str(*dir); error_msg.push_str("' already exists"); }