sleep(1): reduce dependence on sysexits

This commit is contained in:
dtb 2024-05-03 21:22:38 -06:00
parent 82f6c46b64
commit b06c1d5488
Signed by: trinity
GPG Key ID: 31FF85CCB6DC7641

View File

@ -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])
}