fop(1): better opt matching

This commit is contained in:
Emma Tebibyte 2024-07-28 18:27:22 -06:00
parent 68e31058a8
commit 6b9d13b8a0
Signed by: emma
GPG Key ID: 06FA419A1698C270

View File

@ -42,12 +42,12 @@ fn main() {
while let Some(opt) = argv.getopt("d:") { while let Some(opt) = argv.getopt("d:") {
match opt.opt() { match opt.opt() {
Ok(_) => { Ok("d") => {
/* delimiter */ /* delimiter */
d = opt.arg().unwrap(); d = opt.arg().unwrap();
optind = opt.ind(); optind = opt.ind();
}, },
Err(_) => { _ => {
eprintln!("{}", usage); eprintln!("{}", usage);
exit(EX_USAGE); exit(EX_USAGE);
} }