diff --git a/base64/base64.rs b/base64/base64.rs index 7ac2e032a..2dc8c9188 100644 --- a/base64/base64.rs +++ b/base64/base64.rs @@ -36,7 +36,7 @@ mod util; static NAME: &'static str = "base64"; fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let opts = ~[ optflag("d", "decode", "decode data"), optflag("i", "ignore-garbage", "when decoding, ignore non-alphabetic characters"), diff --git a/cat/cat.rs b/cat/cat.rs index a86fee6c0..41003714b 100644 --- a/cat/cat.rs +++ b/cat/cat.rs @@ -20,7 +20,7 @@ use std::io::stdio::{stdout_raw, stdin_raw}; use std::io::{BufferedWriter}; fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let program = args.get(0).as_slice(); let opts = ~[ getopts::optflag("A", "show-all", "equivalent to -vET"), diff --git a/cksum/cksum.rs b/cksum/cksum.rs index 259d0eaee..b7fc3da5c 100644 --- a/cksum/cksum.rs +++ b/cksum/cksum.rs @@ -78,7 +78,7 @@ fn open_file(name: &str) -> IoResult> { } pub fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let opts = [ getopts::optflag("h", "help", "display this help and exit"), getopts::optflag("V", "version", "output version information and exit"), diff --git a/comm/comm.rs b/comm/comm.rs index dfe8bfc42..238e859af 100644 --- a/comm/comm.rs +++ b/comm/comm.rs @@ -88,7 +88,7 @@ fn open_file(name: &str) -> IoResult> { } pub fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let opts = [ getopts::optflag("1", "", "suppress column 1 (lines uniq to FILE1)"), getopts::optflag("2", "", "suppress column 2 (lines uniq to FILE2)"), diff --git a/cp/cp.rs b/cp/cp.rs index 404722935..af0c35e5f 100644 --- a/cp/cp.rs +++ b/cp/cp.rs @@ -32,7 +32,7 @@ pub enum Mode { } fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let opts = ~[ optflag("h", "help", "display this help and exit"), optflag("", "version", "output version information and exit"), diff --git a/dirname/dirname.rs b/dirname/dirname.rs index 0afdde371..11df43cab 100644 --- a/dirname/dirname.rs +++ b/dirname/dirname.rs @@ -17,7 +17,7 @@ use std::io::print; static VERSION: &'static str = "1.0.0"; fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let program = args.get(0).clone(); let opts = ~[ getopts::optflag("z", "zero", "separate output with NUL rather than newline"), diff --git a/du/du.rs b/du/du.rs index 8f65145f7..3c18cdfd9 100644 --- a/du/du.rs +++ b/du/du.rs @@ -91,7 +91,7 @@ fn du(path: &Path, mut my_stat: Stat, } fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let program = args.get(0).as_slice(); let opts = ~[ // In task diff --git a/echo/echo.rs b/echo/echo.rs index c1979d61d..17da759a3 100644 --- a/echo/echo.rs +++ b/echo/echo.rs @@ -70,7 +70,7 @@ fn convert_str(string: &str, index: uint, base: uint) -> (char, int) { } fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let program = args.get(0).clone(); let opts = ~[ getopts::optflag("n", "", "do not output the trailing newline"), diff --git a/fold/fold.rs b/fold/fold.rs index 483d212e4..ffc597c9a 100644 --- a/fold/fold.rs +++ b/fold/fold.rs @@ -28,9 +28,9 @@ static VERSION: &'static str = "1.0.0"; fn main() { - let (args, obs_width) = handle_obsolete(os::args().as_slice().to_owned()); + let args = os::args(); + let (args, obs_width) = handle_obsolete(args.as_slice()); let program = args.get(0).clone(); - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); let opts = [ getopts::optflag("b", "bytes", "count using bytes rather than columns (meaning control characters such as newline are not treated specially)"), diff --git a/groups/groups.rs b/groups/groups.rs index d267cf252..d46ac19d1 100644 --- a/groups/groups.rs +++ b/groups/groups.rs @@ -26,7 +26,7 @@ use c_types::{get_pw_from_args, group}; static NAME: &'static str = "groups"; fn main () { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let options = [ optflag("h", "", "Help") ]; diff --git a/head/head.rs b/head/head.rs index 8b6ed08f4..6b3dbb035 100644 --- a/head/head.rs +++ b/head/head.rs @@ -31,7 +31,7 @@ fn main () { (args, None) => args }; - let args: Vec = options.iter().map(|x| x.to_strbuf()).collect(); + let args = options; let possible_options = [ optopt("n", "number", "Number of lines to print", "n"), diff --git a/hostname/hostname.rs b/hostname/hostname.rs index 9155d7b5d..b09c6084d 100644 --- a/hostname/hostname.rs +++ b/hostname/hostname.rs @@ -24,8 +24,8 @@ extern { } fn main () { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); - let program = args.get(0).to_owned(); + let args = os::args(); + let program = args.get(0); let options = [ optflag("f", "full", "Default option to show full name"), diff --git a/id/id.rs b/id/id.rs index b9e79b790..a19815c79 100644 --- a/id/id.rs +++ b/id/id.rs @@ -88,7 +88,7 @@ extern { static NAME: &'static str = "id"; fn main () { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let args_t = args.tail(); let options = [ diff --git a/kill/kill.rs b/kill/kill.rs index 97e2e681a..df7010f27 100644 --- a/kill/kill.rs +++ b/kill/kill.rs @@ -54,7 +54,7 @@ pub enum Mode { fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let opts = ~[ optflag("h", "help", "display this help and exit"), diff --git a/logname/logname.rs b/logname/logname.rs index 72aff7554..f543d9083 100644 --- a/logname/logname.rs +++ b/logname/logname.rs @@ -44,7 +44,7 @@ fn version() { } fn main() { - let args: Vec = os::args().iter().map(|x| x.to_strbuf()).collect(); + let args = os::args(); let program = args.get(0).clone(); //