mirror of
https://github.com/gay-pizza/jaarg.git
synced 2026-11-05 02:42:22 +00:00
Split parse state validation and make parse context arg optional.
This commit is contained in:
1 parent
75e2bde5fb
commit
afffd1ef91
5 files changed
+35
-29
No files matched your search
@@ -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