mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 01:38:04 +00:00
env::args return Strings now
This commit is contained in:
parent
ec9c8659ea
commit
50301e63ee
3 changed files with 4 additions and 8 deletions
|
@ -10,17 +10,13 @@ extern crate \"@UTIL_CRATE@\" as uu@UTIL_CRATE@;
|
|||
use std::env;
|
||||
use uu@UTIL_CRATE@::uumain;
|
||||
|
||||
fn args() -> Vec<String> {
|
||||
env::args().map(|a| a.into_string().unwrap()).collect()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
env::set_exit_status(uumain(args()));
|
||||
env::set_exit_status(uumain(env::args().collect()));
|
||||
}
|
||||
";
|
||||
|
||||
fn main() {
|
||||
let args : Vec<String> = env::args().map(|a| a.into_string().unwrap()).collect();
|
||||
let args : Vec<String> = env::args().collect();
|
||||
if args.len() != 3 {
|
||||
println!("usage: mkbuild <crate> <outfile>");
|
||||
env::set_exit_status(1);
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::old_io::{File, Truncate, Write};
|
|||
use std::old_path::Path;
|
||||
|
||||
fn main() {
|
||||
let args : Vec<String> = env::args().map(|a| a.into_string().unwrap()).collect();
|
||||
let args : Vec<String> = env::args().collect();
|
||||
if args.len() < 3 {
|
||||
println!("usage: mkuutils <outfile> <crates>");
|
||||
env::set_exit_status(1);
|
||||
|
|
|
@ -41,7 +41,7 @@ fn usage(cmap: &HashMap<&'static str, fn(Vec<String>) -> i32>) {
|
|||
|
||||
fn main() {
|
||||
let umap = util_map();
|
||||
let mut args : Vec<String> = env::args().map(|a| a.into_string().unwrap()).collect();
|
||||
let mut args : Vec<String> = env::args().collect();
|
||||
|
||||
// try binary name as util name.
|
||||
let binary = Path::new(args[0].as_slice());
|
||||
|
|
Loading…
Reference in a new issue