-- を引数区切りとして機能させる#32
Conversation
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
|
Warning Review limit reached
Next review available in: 33 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
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.
- 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
Closes #23
変更内容
src/cli.rsのoptionsをtrailing_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