fop(1): fixes panic on no arguments

This commit is contained in:
Emma Tebibyte 2024-08-28 18:05:56 -06:00
parent 8d00fa0afd
commit f50bfeea92
Signed by: emma
GPG Key ID: 06FA419A1698C270
2 changed files with 3 additions and 0 deletions

View File

@ -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") => {

View File

@ -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