Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Parsing --help needs to return something other than an error

オープン
#72 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
lua
領域
cli

調査の方向性

まず、--help のテキストがどのようにパースされ、パースエラーとリターンコードがどのように公開されるかを追跡します。比較のため、リンクされた halp issue と busted pull requests に記載されている動作を確認します。明示的に --help を要求すると成功ステータスとともにヘルプメッセージが生成され、呼び出し側がメッセージテキストを照合する必要がなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

The way the --help text is parsed the message is returned in the same field as an actual parsing error, and the return code is the same as if it was a failure case. However a user actually passing --help explicitly should be considered a success.

The only way I came up with to work around this was to test the error string for :match("^Usage:") and switch gears from error handling to closing with a success status after the message. There really should be a more ergonomic way to do this. As it is most lua apps that implement CLIs with this library return a failure code when they should not.

c.f. https://github.com/orhun/halp/issues/20
c.f. https://github.com/sile-typesetter/sile/pull/1737/files
c.f. https://github.com/lunarmodules/busted/pull/732
c.f. https://github.com/lunarmodules/busted/pull/733#discussion_r1429943388

主要言語
Lua
スター
129
フォーク
26
平均マージ
1時間 41分
マージ済み PR(30日)
1

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lunarmodules/lua_cliargs のほかの issue

lunarmodules/lua_cliargs の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。