Repository navigation
Define shared numeric environment/default semantics for count flags #1438
zeitlinger
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Use case
We are experimenting with the Go generator for OATs, a small CLI with
-v/-vv/-vvvand a documentedOATS_VERBOSE=3environment setting. I'd prefer contributing shared behavior upstream rather than teaching an application adapter to reinterpret counts.For this spec:
At v6.9.1, generated Go
Parse(nil)returns verbosity 0 withOATS_VERBOSE=3. The generator explicitly skips count fallbacks. The Rust reference's environment fallback for a valueless flag instead uses boolean truthiness. That makes this a semantics proposal, not simply a Go bug fix.Proposed contract
-vvvis 3.OATS_VERBOSE=3 cli -vis 1.--verbose=3syntax: unsupported attached values should not silently become one occurrence.Would this fit the intended count semantics? If so, I'm happy to contribute shared conformance vectors first, then the corresponding implementation and generated-parser regression tests. If counts are intentionally argv-only, a lint diagnostic for incompatible env/default declarations would be preferable to silently accepting them.
I understand usage-go is a development preview; this is feedback from an intentional experiment, not a request for an adoption/stability guarantee.
AI-assisted proposal written using OpenAI Codex.
All reactions