Repository navigation
Project Tom Hagen: bind positional arguments - #27
Merged
Merged
Conversation
commit: |
cowboyd
force-pushed
the
project-tom-hagen-arguments
branch
from
September 9, 2026 01:21
7ea47ca to
00f9d3e
Compare
cowboyd
force-pushed
the
project-tom-hagen-arguments
branch
2 times, most recently
from
September 9, 2026 01:54
303561a to
2417ae7
Compare
cowboyd
force-pushed
the
project-tom-hagen-arguments
branch
from
September 9, 2026 03:23
2417ae7 to
a45b729
Compare
cowboyd
force-pushed
the
project-tom-hagen-arguments
branch
4 times, most recently
from
September 23, 2026 15:03
6908fe9 to
751c42e
Compare
cowboyd
force-pushed
the
project-tom-hagen-arguments
branch
from
September 23, 2026 15:04
751c42e to
bf59fe7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Configliere could bind named options but had no public positional-argument definition. Adding positional readers also exposes a real ambiguity: an argument must not steal the value belonging to an option merely because the argument was declared first.
Positional arguments need to preserve route segmentation, source precedence, validation, exact model inference, and useful help output.
Approach
Model positional arguments as ordinary parameters with a CLI reader, not as a separate parsing subsystem. Route selectors are still resolved first, so a visible command word cannot be consumed as data. Within the selected route segment, every unresolved reader proposes a claim against the same immutable token view; the binder commits the claim beginning earliest in argv, with declaration order breaking exact ties, then asks all remaining readers again.
This claim-arbitration model prevents positional arguments from stealing option values without teaching the binder about particular reader kinds. Failed reads retain ownership of the tokens they captured, and tokens settled in an earlier phase are never reinterpreted after dynamic expansion. Arguments otherwise follow the same route scoping, source precedence, decoding, validation, and model inference as options. Declarative syntax metadata lets help render arguments without executing or reverse-engineering their readers.