feat(parse): support inferred prefixes - #1080
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
a34c3da to
8f3d76f
Compare
b5c2b21 to
b489d37
Compare
Instruction countsNothing was compared, and so nothing was gated. No series appears on both sides: either the base has no measurements recorded, or the two were measured on different runner classes, which are deliberately not comparable — counts shift between machine types by more than a real regression does. New, nothing to compare against: 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 comparisonParsing
|
83286d9 to
474e8c6
Compare
474e8c6 to
bd7073c
Compare
bd7073c to
72c4d6b
Compare
2644fef to
47cc78c
Compare
bb4fbf8 to
403fb6c
Compare
403fb6c to
87f9da9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 87f9da9. Configure here.

Summary
Validation
cargo test -p usage-argv --all-featurescargo test -p usage-lib --all-featurescargo test -p usage-conformance --all-featurescargo clippy --all --all-features --all-targets -- -D warningsUSAGE_BIN=../target/debug/usage go test ./...fromgo/This pull request was generated by an AI coding agent.
Note
Medium Risk
Changes core argv parsing and help routing in Rust, Go, and usage-lib when inference is enabled; behavior is opt-in but must stay consistent across emitters and runtimes.
Overview
Adds
infer_subcommandsandinfer_long_argsso CLIs can accept only unambiguous prefixes of subcommand names/aliases and long flags (including negations), with exact spellings always winning and ambiguous prefixes rejected.The policy is inherited as the parser descends, wired through
#[usage(infer_subcommands, infer_long_args)], KDL/spec fields, usage-lib parsing, usage-argv (Rust + Go), generated tables, and help routing (help insta-style paths). Built-inhelp/--helpparticipate in prefix rules without colliding with declaredhelper/--help-allwhen that would be ambiguous.Docs note clap’s no public getters for these globals, so the clap bridge cannot infer them. PLAN.md marks this gap closed. Long-flag lookup is refactored so negated value flags (e.g.
--no-mode) no longer consume the following positional.Reviewed by Cursor Bugbot for commit 53c5807. Bugbot is set up for automated code reviews on this repo. Configure here.