Parsing --help needs to return something other than an error
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by tracing how the --help text is parsed and how parsing errors and return codes are exposed. Review the behavior described in the linked halp issue and busted pull requests for comparison. Done means explicitly requesting --help produces the help message with a success status, without requiring callers to match the message text.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Lua
- Stars
- 129
- Forks
- 26
- Avg merge
- 1h 41m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lunarmodules/lua_cliargs
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lunarmodules/lua_cliargs#85 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 48/100
lunarmodules/lua_cliargs#70 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
lunarmodules/lua_cliargs#69 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
lunarmodules/lua_cliargs#68 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
lunarmodules/lua_cliargs#67 ·
All issues in lunarmodules/lua_cliargs
Similar issues
-
bug
Difficulty 2/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
omacom/omarchy#14075 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
ai-authored
Difficulty 2/5 1-3 hours Newbie friendliness 88/100