GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(parse)!: a command that needs a subcommand says so by jdx · Pull Request #992 · jdx/usage Conversation
|
|
Warning Review limit reached
Next review available in: 1 second Limit details: You’ve used all 4 included reviews currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 689c979. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| /// argv as `parse` wants it, program name included. | ||
| fn words(of: &[&str]) -> Vec<String> { | ||
| of.iter().map(|s| s.to_string()).collect() | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Low Severity
The new words helper duplicates the existing input helper in the same test module, which already converts &[&str] to Vec<String> and is used throughout these tests. Preferring input would also avoid the misplaced feature-gate issue around words.
Reviewed by Cursor Bugbot for commit 689c979. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Greptile SummaryThe PR makes usage-lib enforce
Confidence Score: 4/5The default-feature usage-lib test target must be fixed before merging; the all-hidden-subcommand diagnostic should also be made complete. The runtime enforcement generally follows the intended command semantics, but the newly added unconditional test references a feature-gated helper and therefore does not compile under default features; commands with only hidden children also receive an incomplete error message. Files Needing Attention: lib/src/parse.rs, lib/src/error.rs Important Files Changed
Reviews (1): Last reviewed commit: "fix(parse)!: a command that needs a subc..." | Re-trigger Greptile |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| #[cfg(feature = "unstable_choices_env")] | ||
| /// argv as `parse` wants it, program name included. | ||
| fn words(of: &[&str]) -> Vec<String> { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Feature-gated helper breaks default tests
When usage-lib tests run with default features, the unconditional test calls words after its only definition has been removed by the unstable_choices_env gate, causing test compilation to fail with an unresolved function.
| #[cfg(feature = "unstable_choices_env")] | |
| /// argv as `parse` wants it, program name included. | |
| fn words(of: &[&str]) -> Vec<String> { | |
| /// argv as `parse` wants it, program name included. | |
| fn words(of: &[&str]) -> Vec<String> { |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| out.errors.push(UsageErr::MissingSubcommand( | ||
| out.cmd.name.clone(), | ||
| names.join(", "), | ||
| )); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Instruction counts
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 comparisonParsing
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
This file said "usage-lib is lax where usage-argv and clap agree", and PLAN.md said the three cases were usage-lib's to tighten. One was — `subcommand_required` was in the spec and no parser read it, fixed in #992. **The other two are the grammar working as specified**, and the corpus says so in its own words: - `long-repeated-keeps-the-last` — "a repeat is a correction — typically a wrapper appending to a command line it did not write — so the last word on the subject is the one that counts." - `long-unknown` — "an unrecognized long flag is offered to the positionals like any other word… more likely data in transit than a mistake", with `unknown_flags "error"` as the opt-in for strictness. I found that out by acting on the wrong reading: the tightening got as far as three failing conformance vectors — `long-repeated-keeps-the-last`, `long-boolean-repeated`, `a-bound-counts-one-occurrence` — before the mistake surfaced. Reverted, and this is what should have been written instead. The refusals come from a different layer, which is what the framing missed: `Error::DuplicateFlag` is constructed in exactly one place, `derive/src/codegen.rs`, and never by usage-argv's parser. | | a flag given twice | |---|---| | usage-argv, the parser | accepts, last wins — conformant | | usage-lib | accepts, last wins — conformant | | usage-derive's post-binding check | refuses | | clap | refuses | Both are right in their own domain. A derive-generated binary is what an adopter compares against clap, and there the two agree. A spec-driven parse is what mise runs *task* arguments through, where the wrapper case above is the documented one. So the disagreement is a fact about the layers, not a defect to close. Prose alone would not have stopped me, so the claim is a test: `usage_lib_accepting_a_repeat_is_the_grammar_not_a_defect` fails if usage-lib is made to refuse either shape, with the corpus vector named in the message. Mutation-checked against exactly the change I nearly landed.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.