mm(1): fixes mm without arguments not working

This commit is contained in:
Emma Tebibyte 2024-08-10 14:20:38 -06:00
parent 2a75b8f820
commit d89707a47c
Signed by: emma
GPG Key ID: 06FA419A1698C270

View File

@ -131,6 +131,11 @@ fn main() -> ExitCode {
}
}
if ins.is_empty() && outs.is_empty() && argv.len() > optind {
eprintln!("Usage: {}", usage);
return ExitCode::from(EX_USAGE as u8);
}
/* use stdin if no inputs are specified */
if ins.is_empty() { ins.push("-".to_string()); }