hru(1): error handling tweaks
This commit is contained in:
parent
ee3877b607
commit
bd08ef479c
16
src/hru.rs
16
src/hru.rs
@ -19,13 +19,13 @@
|
|||||||
use std::{
|
use std::{
|
||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
env::args,
|
env::args,
|
||||||
io::stdin,
|
io::{ stdin, stdout, Write },
|
||||||
process::ExitCode,
|
process::{ ExitCode, exit },
|
||||||
};
|
};
|
||||||
|
|
||||||
extern crate sysexits;
|
extern crate sysexits;
|
||||||
|
|
||||||
use sysexits::{ EX_DATAERR, EX_SOFTWARE };
|
use sysexits::{ EX_DATAERR, EX_IOERR, EX_SOFTWARE };
|
||||||
|
|
||||||
const LIST: [(u32, &str); 10] = [
|
const LIST: [(u32, &str); 10] = [
|
||||||
(3, "k"),
|
(3, "k"),
|
||||||
@ -79,7 +79,7 @@ fn main() -> ExitCode {
|
|||||||
f
|
f
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("{}: {}", argv[0], err);
|
eprintln!("{}: {}.", argv[0], err);
|
||||||
return ExitCode::from(EX_DATAERR as u8);
|
return ExitCode::from(EX_DATAERR as u8);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||