Skip to content

fix: accept -C/--repo-dir and --minimal-dir after the subcommand - #1042

Merged
norrietaylor merged 2 commits into
mainfrom
inbox-patch/global-args-post-subcommand-40c4b187816dfd82
Jul 29, 2026
Merged

fix: accept -C/--repo-dir and --minimal-dir after the subcommand#1042
norrietaylor merged 2 commits into
mainfrom
inbox-patch/global-args-post-subcommand-40c4b187816dfd82

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #1039
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmgfYg

repo_dir (-C/--repo-dir) and minimal_dir (--minimal-dir) were the only GlobalArgs fields with a bare #[arg(long)]; every other field carries global = true. Without it clap rejected both flags after a subcommand (exit 2), which also broke complete-session-str's documented promise to honour --minimal-dir. Adding global = true to both — matching config_dir, provider, and no_input — fixes both positions, and a parse test pins post-subcommand acceptance. The docs list both as global flags, confirming intent (informed by the Minimal CLI Reference, docs/reference/cli.md). Scope note: mip's GlobalArgs carries the same omission, but issue #1039 is entirely about the min CLI, so this patch leaves mip untouched.

Verification

cargo fmt --all --check --manifest-path target/Cargo.toml — clean, exit 0
cargo clippy --workspace --locked -- -D warnings — 0 warnings, exit 0 (finished in 10m45s)
cargo build --workspace --locked — finished, exit 0
cargo test --workspace --locked — all tests pass, exit 0 (incl. new repo_and_minimal_dir_are_accepted_after_the_subcommand)

Generated by inbox-patch ·

Note

Accept -C/--repo-dir and --minimal-dir flags after subcommands

Marks repo_dir and minimal_dir in GlobalArgs as global = true in their clap #[arg(...)] attributes in lib.rs, so these flags are accepted on either side of a subcommand (e.g. min ls -C /tmp/x --minimal-dir /tmp/y). Previously they were only accepted before the subcommand.

Macroscope summarized f44e9b8.

repo_dir (-C/--repo-dir) and minimal_dir (--minimal-dir) were the only
GlobalArgs fields with a bare #[arg(long)]; every other field carries
global = true. Without it, clap rejected both flags when they appeared
after a subcommand (exit 2), which also broke complete-session-str's
documented promise to honour --minimal-dir.

Add global = true to both, matching config_dir, provider, and no_input,
and pin the post-subcommand acceptance with a parse test.

Closes: #1039
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 77827a60-bc37-4149-b691-89bba02390c6

📥 Commits

Reviewing files that changed from the base of the PR and between 12c81c3 and f44e9b8.

📒 Files selected for processing (1)
  • crates/minimal/src/lib.rs

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

@norrietaylor
norrietaylor enabled auto-merge (squash) July 29, 2026 19:12
main gained a `session destroy` parse test at the same spot in the test
module as this branch's post-subcommand test, so the two additions
collided textually. Both tests are kept; they assert unrelated things.

The `global = true` additions on `repo_dir`/`minimal_dir` merged cleanly
and are unaffected by main's help-text and subcommand restructuring.
@norrietaylor
norrietaylor merged commit cc90826 into main Jul 29, 2026
29 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/global-args-post-subcommand-40c4b187816dfd82 branch July 29, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant