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