1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

remove use of deprecated to_err_msg

This commit is contained in:
Michael Gehring 2014-06-15 12:50:40 +02:00
parent 36ce4a20d4
commit 96c32a70a5
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) { let matches = match getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(e) => { Err(e) => {
error!("error: {:s}", e.to_err_msg()); error!("error: {}", e);
fail!() fail!()
} }
}; };

View file

@ -39,7 +39,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, 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") { 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, 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") { if matches.opt_present("help") {
println!("cat 1.0.0"); 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(err) => fail!("{}", err.to_err_msg()), Err(err) => fail!("{}", err),
}; };
if matches.opt_present("help") { 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(err) => fail!("{}", err.to_err_msg()), Err(err) => fail!("{}", err),
}; };
if matches.opt_present("version") { 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) { let matches = match getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(e) => { Err(e) => {
error!("error: {:s}", e.to_err_msg()); error!("error: {}", e);
fail!() fail!()
}, },
}; };

View file

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

View file

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

View file

@ -65,7 +65,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts(args.tail(), opts) { let matches = match getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(e) => { 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; return EXIT_ERR;
}, },
}; };

View file

@ -71,7 +71,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts(args.tail(), opts) { let matches = match getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(e) => { 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; return EXIT_ERR;
}, },
}; };

View file

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

View file

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

View file

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

View file

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

View file

@ -90,7 +90,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, 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") { 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg()) Err(f) => crash!(1, "{}", f)
}; };
if matches.opt_present("help") { if matches.opt_present("help") {
println!("tac {}", VERSION); 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(); 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 version = format!("{} {}", NAME, VERSION);
let program = args.get(0).as_slice(); let program = args.get(0).as_slice();
let arguments = "[OPTION]... [FILE]..."; 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, 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") { 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(err) => { Err(err) => {
show_error!("{}", err.to_err_msg()); show_error!("{}", err);
return 1; return 1;
} }
}; };

View file

@ -51,7 +51,7 @@ pub fn uumain(args: Vec<String>) -> int {
let matches = match getopts::getopts(args.tail(), opts) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => { 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") m.opt_present("s")
}, },
Err(f) => { Err(f) => {
println(f.to_err_msg().as_slice()); println!("{}", f);
usage(); usage();
return 2; return 2;
} }

View file

@ -68,7 +68,7 @@ pub fn uumain(args: Vec<String>) -> int {
]; ];
let matches = match getopts::getopts(args.tail(), opts) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg()), Err(f) => crash!(1, "{}", f),
}; };
if matches.opt_present("help") { if matches.opt_present("help") {
println!("uname 1.0.0"); 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => { 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, 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") { if matches.opt_present("version") {
println!("uptime 1.0.0"); 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => fail!(f.to_err_msg()), Err(f) => fail!("{}", f),
}; };
if matches.opt_present("help") { 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => { 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => crash!(1, "{}", f.to_err_msg()), Err(f) => crash!(1, "{}", f),
}; };
if matches.opt_present("help") { if matches.opt_present("help") {
println!("whoami 1.0.0"); 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) { let matches = match getopts::getopts(args.tail(), opts) {
Ok(m) => m, Ok(m) => m,
Err(f) => { Err(f) => {
crash!(1, "invalid options\n{}", f.to_err_msg()) crash!(1, "invalid options\n{}", f)
} }
}; };
if matches.opt_present("help") { if matches.opt_present("help") {