forked from bonsai/harakit
sleep(1): reduce dependence on sysexits
This commit is contained in:
parent
82f6c46b64
commit
b06c1d5488
|
@ -24,7 +24,7 @@ use std::{
|
|||
};
|
||||
|
||||
extern crate sysexits;
|
||||
use sysexits::{EX_OK, EX_USAGE};
|
||||
use sysexits::EX_USAGE;
|
||||
|
||||
fn usage(s: &str) -> ExitCode {
|
||||
eprintln!("Usage: {} [seconds]", s);
|
||||
|
@ -37,7 +37,7 @@ fn main() -> ExitCode {
|
|||
if argv.len() == 2 {
|
||||
if let Ok(s) = argv[1].parse::<u64>() {
|
||||
sleep(Duration::from_secs(s));
|
||||
ExitCode::from(EX_OK as u8)
|
||||
ExitCode::SUCCESS
|
||||
} else {
|
||||
usage(&argv[0])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user