1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

Merge pull request #246 from ebfe/remove-to-err-msg

remove use of deprecated to_err_msg
This commit is contained in:
Arcterus 2014-06-15 12:55:01 -07:00
commit 7920c7d9e4
38 changed files with 38 additions and 38 deletions

View file

@ -48,7 +48,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts(args.tail(), opts) {
Ok(m) => m,
Err(e) => {
error!("error: {:s}", e.to_err_msg());
error!("error: {}", e);
fail!()
}
};

View file

@ -39,7 +39,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg())
Err(f) => crash!(1, "Invalid options\n{}", f)
};
if matches.opt_present("help") {

View file

@ -41,7 +41,7 @@ pub fn uumain(args: Vec<String>) -> int {
];
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => fail!("Invalid options\n{}", f.to_err_msg())
Err(f) => fail!("Invalid options\n{}", f)
};
if matches.opt_present("help") {
println!("cat 1.0.0");

View file

@ -88,7 +88,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(err) => fail!("{}", err.to_err_msg()),
Err(err) => fail!("{}", err),
};
if matches.opt_present("help") {

View file

@ -109,7 +109,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(err) => fail!("{}", err.to_err_msg()),
Err(err) => fail!("{}", err),
};
if matches.opt_present("version") {

View file

@ -42,7 +42,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts(args.tail(), opts) {
Ok(m) => m,
Err(e) => {
error!("error: {:s}", e.to_err_msg());
error!("error: {}", e);
fail!()
},
};

View file

@ -29,7 +29,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => fail!("Invalid options\n{}", f.to_err_msg())
Err(f) => fail!("Invalid options\n{}", f)
};
if matches.opt_present("help") {

View file

@ -162,7 +162,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
show_error!("Invalid options\n{}", f.to_err_msg());
show_error!("Invalid options\n{}", f);
return 1;
}
};

View file

@ -85,7 +85,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg())
Err(f) => crash!(1, "Invalid options\n{}", f)
};
if matches.opt_present("help") {

View file

@ -77,7 +77,7 @@ pub fn uumain(args: Vec<String>) {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg())
Err(f) => crash!(1, "Invalid options\n{}", f)
};
if matches.opt_present("help") {

View file

@ -44,7 +44,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg())
Err(f) => crash!(1, "{}", f)
};
if matches.opt_present("h") {

View file

@ -40,7 +40,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts(args.tail(), options) {
Ok(m) => { m },
Err(f) => {
show_error!("{}", f.to_err_msg());
show_error!("{}", f);
return 1;
}
};

View file

@ -65,7 +65,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts(args.tail(), opts) {
Ok(m) => m,
Err(e) => {
show_error!("{}\n{}", e.to_err_msg(), get_help_text(NAME, usage.as_slice()));
show_error!("{}\n{}", e, get_help_text(NAME, usage.as_slice()));
return EXIT_ERR;
},
};

View file

@ -71,7 +71,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts(args.tail(), opts) {
Ok(m) => m,
Err(e) => {
show_error!("{}\n{}", e.to_err_msg(), get_help_text(NAME, usage.as_slice()));
show_error!("{}\n{}", e, get_help_text(NAME, usage.as_slice()));
return EXIT_ERR;
},
};

View file

@ -59,7 +59,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg())
Err(f) => crash!(1, "Invalid options\n{}", f)
};
if matches.opt_present("help") {

View file

@ -49,7 +49,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg())
Err(f) => crash!(1, "{}", f)
};
if matches.opt_present("help") {

View file

@ -48,7 +48,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
crash!(1, "Invalid options\n{}", f.to_err_msg());
crash!(1, "Invalid options\n{}", f);
}
};

View file

@ -37,7 +37,7 @@ pub fn uumain(args: Vec<String>) -> int {
];
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg())
Err(f) => crash!(1, "{}", f)
};
if matches.opt_present("help") {
println!("{} {}", NAME, VERSION);

View file

@ -37,7 +37,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
crash!(1, "Invalid options\n{}", f.to_err_msg())
crash!(1, "Invalid options\n{}", f)
}
};
if matches.opt_present("help") {

View file

@ -36,7 +36,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
crash!(1, "Invalid options\n{}", f.to_err_msg())
crash!(1, "Invalid options\n{}", f)
}
};

View file

@ -53,7 +53,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
crash!(1, "{}", f.to_err_msg())
crash!(1, "{}", f)
}
};
if matches.opt_present("help") {

View file

@ -38,7 +38,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
show_error!("{}", f.to_err_msg());
show_error!("{}", f);
return 1;
}
};

View file

@ -47,7 +47,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => { m }
Err(f) => {
show_error!("{:s}", f.to_err_msg());
show_error!("{}", f);
print_usage(opts);
return 1;
}

View file

@ -37,7 +37,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
show_error!("{}", f.to_err_msg());
show_error!("{}", f);
return 1;
}
};

View file

@ -90,7 +90,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg())
Err(f) => crash!(1, "Invalid options\n{}", f)
};
if matches.opt_present("help") {

View file

@ -38,7 +38,7 @@ pub fn uumain(args: Vec<String>) -> int {
];
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg())
Err(f) => crash!(1, "{}", f)
};
if matches.opt_present("help") {
println!("tac {}", VERSION);

View file

@ -52,7 +52,7 @@ fn options(args: &[String]) -> Result<Options, ()> {
let args: Vec<String> = args.iter().map(|x| x.to_string()).collect();
getopts(args.tail(), opts).map_err(|e| e.to_err_msg()).and_then(|m| {
getopts(args.tail(), opts).map_err(|e| format!("{}", e)).and_then(|m| {
let version = format!("{} {}", NAME, VERSION);
let program = args.get(0).as_slice();
let arguments = "[OPTION]... [FILE]...";

View file

@ -44,7 +44,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(e) => fail!("Invalid options\n{}", e.to_err_msg())
Err(e) => fail!("Invalid options\n{}", e)
};
if matches.opt_present("version") {

View file

@ -161,7 +161,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(err) => {
show_error!("{}", err.to_err_msg());
show_error!("{}", err);
return 1;
}
};

View file

@ -51,7 +51,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
crash!(1, "{}", f.to_err_msg())
crash!(1, "{}", f)
}
};

View file

@ -47,7 +47,7 @@ pub fn uumain(args: Vec<String>) -> int {
m.opt_present("s")
},
Err(f) => {
println(f.to_err_msg().as_slice());
println!("{}", f);
usage();
return 2;
}

View file

@ -68,7 +68,7 @@ pub fn uumain(args: Vec<String>) -> int {
];
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg()),
Err(f) => crash!(1, "{}", f),
};
if matches.opt_present("help") {
println!("uname 1.0.0");

View file

@ -39,7 +39,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
crash!(1, "invalid options\n{}", f.to_err_msg())
crash!(1, "invalid options\n{}", f)
}
};

View file

@ -58,7 +58,7 @@ pub fn uumain(args: Vec<String>) -> int {
];
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "Invalid options\n{}", f.to_err_msg())
Err(f) => crash!(1, "Invalid options\n{}", f)
};
if matches.opt_present("version") {
println!("uptime 1.0.0");

View file

@ -59,7 +59,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => fail!(f.to_err_msg()),
Err(f) => fail!("{}", f),
};
if matches.opt_present("help") {

View file

@ -52,7 +52,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
crash!(1, "Invalid options\n{}", f.to_err_msg())
crash!(1, "Invalid options\n{}", f)
}
};

View file

@ -52,7 +52,7 @@ pub fn uumain(args: Vec<String>) -> int {
];
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg()),
Err(f) => crash!(1, "{}", f),
};
if matches.opt_present("help") {
println!("whoami 1.0.0");

View file

@ -36,7 +36,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
crash!(1, "invalid options\n{}", f.to_err_msg())
crash!(1, "invalid options\n{}", f)
}
};
if matches.opt_present("help") {