1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

mkdir: update for latest Rust

I'm doing this from my phone, but I assume that it's okay to do this directly seeing as I merged mkdir because it was easy to fix.
This commit is contained in:
Arcterus 2014-02-04 08:24:47 -08:00
parent 496a28a301
commit e3ca4fdcf8

View file

@ -51,7 +51,7 @@ fn main() {
return; return;
} }
if matches.opt_present("version") { if matches.opt_present("version") {
println("mkdir v" + VERSION); println!("mkdir v{}", VERSION);
return; return;
} }
let verbose_flag = matches.opt_present("verbose"); let verbose_flag = matches.opt_present("verbose");
@ -83,10 +83,10 @@ fn main() {
fn print_help(opts: &[groups::OptGroup]) { fn print_help(opts: &[groups::OptGroup]) {
println!("mkdir v{} - make a new directory with the given path", VERSION); println!("mkdir v{} - make a new directory with the given path", VERSION);
println(""); println!("");
println("Usage:"); println!("Usage:");
print(groups::usage("Create the given DIRECTORY(ies)" + print!("{}", groups::usage("Create the given DIRECTORY(ies)" +
" if they do not exist", opts)); " if they do not exist", opts));
} }
/** /**
@ -126,7 +126,7 @@ fn exec(dirs: ~[~str], mk_parents: bool, mode: u32, verbose: bool) {
if parent_exists && !path.exists() { if parent_exists && !path.exists() {
// if mkdir failed return // if mkdir failed return
if !mkdir(&path, mode) {return;} if !mkdir(&path, mode) {return;}
if verbose {println(*dir);} if verbose {println!("{}", *dir);}
} else { } else {
let mut error_msg = ~""; let mut error_msg = ~"";
if !parent_exists { if !parent_exists {