mirror of
https://github.com/gay-pizza/jaarg.git
synced 2025-12-19 15:30:16 +00:00
Split parse state validation and make parse context arg optional.
This commit is contained in:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user