GeezerVison is showing github.com — fix(argv): a bare `-` binds where it was typed by jdx · Pull Request #986 · jdx/usage
Conversation
jdx
commented
Aug 17, 2026
•
edited by cursor
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Found by the differential fuzzer in the commit below. usage-argv let a lone -
select the root's default_subcommand — so mise - descended into run,
which has no positional in mise's spec, and the parse failed. usage-lib and
clap both bind it to the root's [TASK].
is_flag_like already calls - a value, "conventionally stdin", and the guard
two lines up already excludes -- on the grounds that a value was never a
candidate to select anything. - belongs in the same exclusion; it was simply
missed, because is_flag_like being false was read as "eligible" rather than
"is a value".
Narrow on purpose: a word that names no command still descends, so mise build
is unchanged — it needs the mount, which is its own open item.
The fuzzer's allow-list loses an arm and gains a witness, which is the shape a
fixed divergence should leave behind.
Stack created with GitHub Stacks CLI • Give Feedback 💬
AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5; version: unavailable.
Note Low Risk
Targeted parser guard change with existing unit coverage and new differential witnesses; behavior aligns with clap/usage-lib for a single-token edge case.
Overview
Fixes routing for a lone - so it binds to the root [TASK] (like usage-lib and clap) instead of selecting default_subcommand and failing inside run with no positional.
The default_subcommand guard now excludes - alongside --: a lone - is not flag-like but is still a value (stdin), not a subcommand selector.
Differential fuzzer documents that allow-list entries must match refusal reasons, not only accept/refuse triples. It adds an explained class for “usage accepts after a positional is bound; clap still routes subcommands” (exposed by mise - bootstrap …) and a regression test pinning that behavior.
Reviewed by Cursor Bugbot for commit 377badc. 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.
greptile-apps[bot] reacted with thumbs up emoji
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: 77f7f4fa-e8fc-4ccd-9b7b-45ba49bc9b64
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:
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
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
The PR prevents a lone - from selecting the default subcommand and expands the mise differential fixture’s reason-aware coverage.
- Treats bare
- as a positional value at the command level where it appears.
- Adds differential cases for words following a bound positional.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
| Filename |
Overview |
| argv/src/lib.rs |
Updates default-subcommand selection so a bare dash remains available for positional binding. |
| benches/gate/tests/differential.rs |
Adds reason-aware mise differential coverage for routing after a positional has bound. |
Reviews (2): Last reviewed commit: "fix(argv): a bare `-` binds where it was..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Instruction counts
| benchmark |
trend |
instructions |
Δ |
wall (min) |
Δ |
| markdown |
█▇▇█▇██▃▁▁ |
196,090,435 → 196,169,682 |
+0.04% |
18.53 → 17.77ms |
-4.07% |
| startup |
███████▁▁▁ |
823,781 → 823,767 |
-0.00% |
0.84 → 0.80ms |
-3.97% |
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.
|
usage |
clap |
ratio |
| instructions, cold parse |
63834 |
5895248 |
92x |
usage: argv -> struct 1078 ns 1.08 µs
clap: build tree + parse -> struct 499377 ns 499.38 µs
clap: parse -> struct, tree reused 23468 ns 23.47 µs
clap: build tree only 310006 ns 310.01 µs
8222cf8993f0 vs 38bef2be9429 · measured on the runner, not pushed to the history.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Found by the differential fuzzer below. usage-argv let a lone `-` *select* the
root's `default_subcommand` — so `mise -` descended into `run`, which has no
positional in mise's spec, and the parse failed. usage-lib and clap both bind it
to the root's `[TASK]`.
`is_flag_like` already calls `-` a value, "conventionally stdin", and the guard
two lines up already excludes `--` on the grounds that a value was never a
candidate to select anything. `-` belongs in the same exclusion; it was missed
because `is_flag_like` being false read as "eligible" rather than "is a value".
Narrow on purpose: a word that names no command still descends, so `mise build`
is unchanged — it needs the mount, which is its own open item.
The fuzzer loses the arm for this and gains a witness, which is the shape a
fixed divergence should leave behind. It also gains one, because accepting `-`
makes a line reachable that was not: `mise - bootstrap packages use` fills the
root's `[TASK]` with `-` and reads the rest as that task's arguments, while clap
keeps looking for a subcommand, finds the real `bootstrap packages use`, and
reports the required argument it declares. Isolated before naming it —
`mise - bootstrap` is accepted by both and `mise bootstrap packages use` is
refused by both, so the difference is what happens to words *after* a positional
binds, not the words themselves.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|