mirror of
https://github.com/gay-pizza/jaarg.git
synced 2025-12-19 07:20:18 +00:00
Backport positional argument handler fix.
This commit is contained in:
@@ -58,6 +58,7 @@ println!("{file:?} -> {out:?} (number: {number:?})",
|
|||||||
### Changelog ###
|
### Changelog ###
|
||||||
|
|
||||||
main:
|
main:
|
||||||
|
* Fixed coerced `ArgumentError` not being rewritten for positional arguments.
|
||||||
* Moved top level includes to `pub use`.
|
* Moved top level includes to `pub use`.
|
||||||
|
|
||||||
v0.2.1:
|
v0.2.1:
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ impl<ID: 'static> Opts<ID> {
|
|||||||
// Find the next positional argument
|
// Find the next positional argument
|
||||||
for (i, option) in self.options[state.positional_index..].iter().enumerate() {
|
for (i, option) in self.options[state.positional_index..].iter().enumerate() {
|
||||||
if matches!(option.r#type, OptType::Positional) {
|
if matches!(option.r#type, OptType::Positional) {
|
||||||
handler(program_name, &option.id, option, option.first_name(), token)?;
|
call_handler(option, option.first_name(), token)?;
|
||||||
state.positional_index += i + 1;
|
state.positional_index += i + 1;
|
||||||
return Ok(ParseControl::Continue);
|
return Ok(ParseControl::Continue);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user