Parsing --help needs to return something other than an error
まだ誰も着手していません。
評価
調査の方向性
まず、--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
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lunarmodules/lua_cliargs のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
lunarmodules/lua_cliargs#85 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 48/100
lunarmodules/lua_cliargs#70 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
lunarmodules/lua_cliargs#69 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
lunarmodules/lua_cliargs#68 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
lunarmodules/lua_cliargs#67 ·
lunarmodules/lua_cliargs の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
openSUSE/python-rpm-macros#219 ·
-
bug mini.bracketed
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
accessibility bug typst
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
quarto-dev/quarto-cli#14947 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
HenrikBengtsson/CBI-software#134 ·
-
Nmap
難易度 1/5 1時間未満 初心者へのやさしさ 85/100