Skip to content

respect argument separations when collecting separate values - #194

Merged
Taywee merged 1 commit into
Taywee:masterfrom
metsw24-max:separate-value-gathering
Jul 28, 2026
Merged

respect argument separations when collecting separate values#194
Taywee merged 1 commit into
Taywee:masterfrom
metsw24-max:separate-value-gathering

Conversation

@metsw24-max

Copy link
Copy Markdown
Contributor

Separate values collected even when they are disallowed

Dropping the else in e319b42 left the value-collection loop in ParseArgsValues running unconditionally, so SetArgumentSeparations no longer reaches it: with separate values off, --jobs 3 on an ImplicitValueFlag takes 3 instead of leaving it positional, and --nums=1 2 fills a Nargs{2, 3} flag. The awkward one is with joined short values off, where -nf 5 now takes 5 as n's value, so ParseShort breaks out of the chunk and f is silently dropped with nothing reported. Gated the loop on separate values being allowed and on the joined value having actually been taken rather than discarded; the added test covers all three plus the joined-then-separate nargs case from e319b42, and fails on master.

@Taywee

Taywee commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Good catch. Nargs is perpetually a weird corner case.

Thanks for the fix.

@Taywee
Taywee merged commit fe4450b into Taywee:master Jul 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants