From d89707a47c986c8ccdc573201380bb049c9c2dba Mon Sep 17 00:00:00 2001 From: emma Date: Sat, 10 Aug 2024 14:20:38 -0600 Subject: [PATCH] mm(1): fixes mm without arguments not working --- src/mm.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mm.rs b/src/mm.rs index 6f3bfa8..b99bf9e 100644 --- a/src/mm.rs +++ b/src/mm.rs @@ -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()); }