diff --git a/src/fop.rs b/src/fop.rs index b6da510..261aba5 100644 --- a/src/fop.rs +++ b/src/fop.rs @@ -61,6 +61,8 @@ fn main() -> ExitCode { } } + if argv.len() == 1 { return ExitCode::from(usage(&argv[0])); } + while let Some(opt) = argv.getopt("d:") { match opt.opt() { Ok("d") => { diff --git a/tests/bonsai/fop.mk b/tests/bonsai/fop.mk index b538031..230e1c1 100755 --- a/tests/bonsai/fop.mk +++ b/tests/bonsai/fop.mk @@ -24,6 +24,7 @@ fop_fail: $(BIN)/fop ! printf 'test\n' | $(BIN)/fop 1 cat ! printf 'test\n' | $(BIN)/fop 'test' cat ! printf 'test\n' | $(BIN)/fop -d'test' cat + ! $(BIN)/fop .PHONY: fop_functionality fop_functionality: $(BIN)/fop