GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(parse): add scalar repeat policy by jdx · Pull Request #1102 · jdx/usage

Conversation

@jdx

@jdx jdx commented Aug 20, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Owner

Summary

  • make repeated scalar flags permissive by default, with the later value winning
  • add args_override_self=false as the strict opt-in across KDL, usage-lib, typed Rust, generated Go, and the clap bridge
  • document the intentional difference from clap and update PLAN.md

Repeatable, variadic, and count flags keep collecting normally. The clap bridge emits strictness because clap defaults to rejecting scalar repeats.

Validation

  • cargo test --all --all-features
  • mise run lint
  • USAGE_BIN=/home/coder/src/usage-fixed-arity/target/debug/usage go test ./...

AI-generated PR description.


Note

Medium Risk
Default behavior changes for derive-generated CLIs that previously always rejected duplicate scalars; strictness is opt-in but the new default affects every command unless callers declare args_override_self=false.

Overview
Repeated scalar flags are permissive by default — a later --jobs or switch occurrence corrects the earlier one, matching usage-argv/usage-lib and the corpus. args_override_self=false on a command (KDL, #[usage(args_override_self = false)], or clap-derived specs) restores clap-style DuplicateFlag errors for single-valued flags; repeatable, variadic, and count flags are unchanged.

The policy is threaded end-to-end: CommandMeta / spec KDL (omit when default true), usage-lib parse with per-command-level tracking for strict globals and negated spellings, derive post-binding checks gated on the flag (flattened args use the parent’s policy via check_with_args_override_self), generated Go (RejectDuplicate, duplicate tracking in the typed parser), and clap bridge (emits args_override_self #false for clap’s default strictness).

Docs and gates update PLAN.md, migration/compatibility guides, differential fuzz expectations (derive now accepts repeats like the parser), and conformance tests; tests that still need strict duplicates opt in explicitly.

Reviewed by Cursor Bugbot for commit ee6d334. Bugbot is set up for automated code reviews on this repo. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 1168e936-b48a-4ecb-950d-7b5ab2d54b51

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 20, 2026
View reviewed changes
Comment thread derive/src/codegen.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/src/parse.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from 51a284b to 7d94438 Compare August 20, 2026 03:36
cursor[bot]
cursor Bot reviewed Aug 20, 2026
View reviewed changes
Comment thread lib/src/spec/cmd.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from 7d94438 to 3b75958 Compare August 20, 2026 03:50
cursor[bot]
cursor Bot reviewed Aug 20, 2026
View reviewed changes
Comment thread lib/src/parse.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from 3b75958 to 580a458 Compare August 20, 2026 04:05
@jdx
jdx force-pushed the agent/command-parsing-policy branch from 580a458 to f28af24 Compare August 20, 2026 04:08
cursor[bot]
cursor Bot reviewed Aug 20, 2026
View reviewed changes
Comment thread lib/src/go/structs.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from f28af24 to a9becee Compare August 20, 2026 04:21
cursor[bot]
cursor Bot reviewed Aug 20, 2026
View reviewed changes
Comment thread go/internal/spec/spec.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from a9becee to 85a6b6e Compare August 20, 2026 04:32
cursor[bot]
cursor Bot reviewed Aug 20, 2026
View reviewed changes
Comment thread derive/src/codegen.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from 85a6b6e to a2233f6 Compare August 20, 2026 04:42
@jdx
jdx force-pushed the agent/command-parsing-policy branch from a2233f6 to 605effd Compare August 20, 2026 04:48
cursor[bot]
cursor Bot reviewed Aug 20, 2026
View reviewed changes
Comment thread lib/src/parse.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from 605effd to a069370 Compare August 20, 2026 04:53
@jdx
jdx force-pushed the agent/command-parsing-policy branch from a069370 to 5a23fea Compare August 20, 2026 04:55
cursor[bot]
cursor Bot reviewed Aug 20, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5a23fea. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/src/parse.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from 5a23fea to c6bce68 Compare August 20, 2026 05:01
@jdx
jdx force-pushed the agent/command-parsing-policy branch 2 times, most recently from 2b7a0a3 to bfd77b0 Compare August 20, 2026 05:37
@jdx
jdx force-pushed the agent/command-parsing-policy branch from bfd77b0 to 19793ec Compare August 20, 2026 05:52
@jdx
jdx force-pushed the agent/command-parsing-policy branch from 19793ec to 0211495 Compare August 20, 2026 05:54
@github-actions

github-actions Bot commented Aug 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
markdown ██▁▁ 195,885,616 → 196,034,921 +0.08% 17.97 → 18.08ms +0.59%
startup ▁▁▇█ 1,218,344 → 1,218,475 +0.01% 1.32 → 1.33ms +0.71%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

Shadow comparison

Parsing mise use -g node@20 against a shadow of mise's committed spec.
Reported, not gated: the shadow grows as the derive learns to express more, so
what to watch is the ratio rather than either column.

framework instructions, cold parse vs usage
usage 4238 —
argh 6292 1.5x
clap 5893640 1390x
bpaf 21917948 5171x
                                              min       p01       p10    median
usage-rs: argv -> struct                      195       197       203       207  ns
argh: argv -> struct                          274       278       282       290  ns
clap: build tree + parse -> struct         481496    483182    488107    514903  ns
bpaf: build parser + parse -> struct      1670926   1670926   1690722   1716402  ns

usage: argv -> struct                             221 ns      0.22 µs
clap: build tree + parse -> struct             492172 ns    492.17 µs
clap: parse -> struct, tree reused              23266 ns     23.27 µs
clap: build tree only                          305331 ns    305.33 µs

ee6d334ef46c vs 1cfb2f535fc7 · measured on the runner, not pushed to the history.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx force-pushed the agent/command-parsing-policy branch from 0211495 to c424975 Compare August 20, 2026 07:05
@jdx
jdx force-pushed the agent/command-parsing-policy branch from c424975 to 7abdf01 Compare August 20, 2026 07:17
@jdx
feat(parse): add scalar repeat policy
ee6d334
@jdx
jdx force-pushed the agent/command-parsing-policy branch from 7abdf01 to ee6d334 Compare August 20, 2026 07:53
@jdx
jdx merged commit 41a8a64 into main Aug 20, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@jdx
jdx deleted the agent/command-parsing-policy branch August 20, 2026 10:50
@mise-en-dev mise-en-dev mentioned this pull request Aug 22, 2026
chore: release v6.0.0 #795
Merged
@BrewTestBot BrewTestBot mentioned this pull request Aug 22, 2026
usage 6.0.0 Homebrew/homebrew-core#300125
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@jdx
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.