driver: an unknown --opt= goal should name the valid goals
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/driver/main.cの8580行目付近にある--pass=/--no-pass=の処理と、src/driver/options.def(114~121行目)の--opt=エントリを読む。tests/golden/options-table.shまたはtests/golden/gcc-flags.shにテストを追加し、無効な目標を指定したときに有効な目標が列挙され、使用方法のテキストが省略されることを確認する。メッセージがオプションテーブルから生成され、テストが通れば完了。
索引モデルが issue の本文から書いたものです。
説明
Context. --opt= takes a goal (none, basic, debug, speed, max, size, min-size). A wrong one gets a generic error and the whole usage text:
$ ./embcc --opt=sped -c t.c
embcc: error: unknown argument '--opt=sped'
usage: embcc [-c|-S|-E] SOURCE... [-o FILE] ...
--pass= already does better: embcc: error: --pass=X: no optimizer pass has that name; the passes are a, b and c. --opt= should do the same, and suggest the closest goal.
Where.
src/driver/main.c, around line 8580: the--pass=/--no-pass=branch, which is the pattern to follow. The genericunknown argumenterror comes right after it.src/driver/options.def, lines 114–121: the--opt=goals are entries in the option table, so the list does not need typing in again.- Tests:
tests/golden/options-table.shandtests/golden/gcc-flags.shalready check option errors.
Steps.
- When
opt_typed(argv[i])starts with--opt=and matched no entry, printembcc: error: --opt=sped: not a goal; the goals are none, basic, debug, speed, max, size and min-size. Build the list from the option table. - Optionally, add
did you mean --opt=speed?when one goal is close. - Add a test that checks the message, and that the usage text is no longer printed.
Done when an unknown --opt= names the valid goals, the list comes from options.def (adding a goal there updates the message), and the tests pass.
Before you start: the contributor's guide has the rules. A new test counts only after it has failed against the code before your change, and a commit subject reads area: summary. Questions are welcome in the comments or in Discussions.
- 主要言語
- C
- スター
- 1
- フォーク
- 2
- 平均マージ
- 20時間 55分
- マージ済み PR(30日)
- 73
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
EmbLinkOs/EmbCC のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
EmbLinkOs/EmbCC の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area: test kind: bug preview-effort: small priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
libsdl-org/SDL#16684 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
Issue-Bug Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信