1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

replace writing to stderr with fail

This commit is contained in:
Heather 2014-02-04 11:33:53 +04:00
parent efae9b621f
commit c8a2b4f6e0

View file

@ -12,7 +12,7 @@
extern mod extra;
use std::os;
use std::io::{print, stderr};
use std::io::print;
use extra::getopts::groups;
static VERSION: &'static str = "1.0.0";
@ -28,12 +28,7 @@ fn main() {
let matches = match groups::getopts(args.tail(), opts) {
Ok(m) => m,
Err(f) => {
writeln!(&mut stderr() as &mut Writer,
"Invalid options\n{}", f.to_err_msg());
os::set_exit_status(1);
return
}
Err(f) => fail!("Invalid options\n{}", f.to_err_msg())
};
if matches.opt_present("help") {