Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#72 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
lua
Domain
cli

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lunarmodules/lua_cliargs

All issues in lunarmodules/lua_cliargs

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.