Backport positional argument handler fix.

This commit is contained in:
2025-11-26 15:12:49 +11:00
parent 7165bb9841
commit 20f5a0bf10
2 changed files with 2 additions and 1 deletions

View File

@@ -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:

View File

@@ -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);
} }