Split parse state validation and make parse context arg optional.

This commit is contained in:
a_dinosaur committed 2025-11-18 13:01:32 +11:00
1 parent 75e2bde5fb
commit afffd1ef91
5 files changed
+35 -29

No files matched your search

+3 -3
View File
@@ -44,9 +44,9 @@ extern "C" fn safe_main(args: &[&str]) -> ExitCode {
print!("{}", StandardFullHelpWriter::<'_, Arg>::new(ctx));
return Ok(ParseControl::Quit);
}
Arg::Number => { number = str::parse(ctx.arg)?; }
Arg::File => { file = ctx.arg.into(); }
Arg::Out => { out = Some(ctx.arg.into()); }
Arg::Number => { number = str::parse(ctx.arg.unwrap())?; }
Arg::File => { file = ctx.arg.unwrap().into(); }
Arg::Out => { out = Some(ctx.arg.unwrap().into()); }
}
Ok(ParseControl::Continue)
}, |program_name, error| {