diff --git a/mkmain.rs b/mkmain.rs index ebb71d26a..7dd36fc0b 100644 --- a/mkmain.rs +++ b/mkmain.rs @@ -1,7 +1,6 @@ #![feature(core, env, io, os, path)] use std::env; use std::old_io::{File, Truncate, ReadWrite}; -use std::os; use std::old_path::Path; static TEMPLATE: &'static str = "\ @@ -9,16 +8,19 @@ static TEMPLATE: &'static str = "\ extern crate \"@UTIL_CRATE@\" as uu@UTIL_CRATE@; use std::env; -use std::os; use uu@UTIL_CRATE@::uumain; +fn args() -> Vec { + env::args().map(|a| a.into_string().unwrap()).collect() +} + fn main() { - env::set_exit_status(uumain(os::args())); + env::set_exit_status(uumain(args())); } "; fn main() { - let args = os::args(); + let args : Vec = env::args().map(|a| a.into_string().unwrap()).collect(); if args.len() != 3 { println!("usage: mkbuild "); env::set_exit_status(1); diff --git a/mkuutils.rs b/mkuutils.rs index e9a2c0984..d30d6bb21 100644 --- a/mkuutils.rs +++ b/mkuutils.rs @@ -6,7 +6,7 @@ use std::os; use std::old_path::Path; fn main() { - let args = os::args(); + let args : Vec = env::args().map(|a| a.into_string().unwrap()).collect(); if args.len() < 3 { println!("usage: mkuutils "); env::set_exit_status(1); diff --git a/src/tee/tee.rs b/src/tee/tee.rs index 754857eb1..199105be6 100644 --- a/src/tee/tee.rs +++ b/src/tee/tee.rs @@ -150,5 +150,5 @@ fn with_path(path: &Path, mut cb: F) -> IoResult where F: FnMut() -> Io } fn warn(message: &str) { - error!("{}: {}", os::args()[0], message); + error!("tee: {}", message); } diff --git a/src/uutils/uutils.rs b/src/uutils/uutils.rs index b839c8a3f..aaf92bc74 100644 --- a/src/uutils/uutils.rs +++ b/src/uutils/uutils.rs @@ -42,7 +42,7 @@ fn usage(cmap: &HashMap<&'static str, fn(Vec) -> i32>) { fn main() { let umap = util_map(); - let mut args = os::args(); + let mut args : Vec = env::args().map(|a| a.into_string().unwrap()).collect(); // try binary name as util name. let binary = Path::new(args[0].as_slice());