mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
replace writing to stderr with fail
This commit is contained in:
parent
efae9b621f
commit
c8a2b4f6e0
1 changed files with 2 additions and 7 deletions
|
@ -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") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue