Skip to content

-- を引数区切りとして機能させる#32

Merged
TwoSquirrels merged 2 commits into
mainfrom
double-dash
Jul 7, 2026
Merged

-- を引数区切りとして機能させる#32
TwoSquirrels merged 2 commits into
mainfrom
double-dash

Conversation

@TwoSquirrels

Copy link
Copy Markdown
Owner

Closes #23

変更内容

src/cli.rsoptionstrailing_var_arg = true, allow_hyphen_values = true から last = true に変更しました。clap の last はその引数を -- の後ろ限定にするもので、Issue の要求と一対一に対応します。

  • -- より後ろだけがコンパイラへ渡るようになる
  • <file> の後ろに書いた risundle のオプション (risundle main.cpp -e など) も解釈される
  • -- 無しでハイフン引数を書くと unknown option としてエラーになる (これまで黙ってコンパイラへ流れていたのがフェイルファストに)

usage 表示も [-- <OPTIONS>...] に自動で変わり、README の記載 (risundle [OPTIONS] <FILE> [-- <COMPILER OPTIONS>...]) が初めて実挙動と一致します。ドキュメント側は元から desired behavior で書かれていたため変更不要でした。

テスト

  • src/cli.rs にパースのユニットテスト 3 本 (ファイル後のオプション解釈 / -- 区切り / -- 前のハイフン引数拒否)
  • tests/cli.rs に結合テスト 1 本 (-- -D<macro> がコンパイラへ届くことを #error ガードで証明)

🤖 Generated with Claude Code

https://claude.ai/code/session_01TwiopnwyFnRbSUyNoFLWAZ

trailing_var_arg が <file> 以降を無条件に拾っていたため、clap の
last = true に置き換え、-- より後ろだけをコンパイラへ渡す。
<file> の後ろに書いた risundle オプションも解釈されるようになり、
-- 無しのハイフン引数はエラーで弾かれる。

Closes #23

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TwiopnwyFnRbSUyNoFLWAZ
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@TwoSquirrels, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44ba2bb4-bd43-448c-ad54-511217188531

📥 Commits

Reviewing files that changed from the base of the PR and between bb697f4 and 925c8e4.

📒 Files selected for processing (2)
  • src/cli.rs
  • tests/cli.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch double-dash

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

-- を引数区切りとして機能させ、-- より後ろだけをコンパイラへ透過的に渡せるようにするための CLI パース仕様変更と、それを担保するテスト追加の PR です(Issue #23 対応)。

Changes:

  • src/cli.rs のコンパイラ透過オプション受け取りを trailing_var_arg から last = true に変更し、-- 以降のみを受け付ける挙動へ変更
  • src/cli.rs に CLI パースのユニットテストを追加(ファイル後の risundle フラグ解釈 / -- 区切り / -- 前ハイフン引数拒否)
  • tests/cli.rs-- -D... がコンパイラへ届くことを確認する結合テストを追加

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/cli.rs -- 区切りに基づいてコンパイラへ渡す引数を厳密化し、パース仕様をユニットテストで固定
tests/cli.rs -- 以降の透過オプションが実際にコンパイラへ到達することを E2E で検証

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cli.rs Outdated
Comment thread tests/cli.rs
- options の help に -- を明記し、value_name を README の
  <COMPILER OPTIONS> 表記に揃える
- バンドル失敗時のアサートメッセージに stderr を含める
  (新テストと run_bundle ヘルパーの両方)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TwiopnwyFnRbSUyNoFLWAZ
@TwoSquirrels TwoSquirrels merged commit 60959f9 into main Jul 7, 2026
9 checks passed
@TwoSquirrels TwoSquirrels deleted the double-dash branch July 7, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-- が引数区切りとして機能していない

2 participants