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

MooseX::Getopt help exits without printing usage text

Open
#1,421 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
perl
Domain
cli, testing-qa

Research direction

Run t/104_override_usage.t and t/109_help_flag.t on both PerlOnJava backends, then trace shared stdout buffering or Test::Trap capture around successful exit. Compare the help and unknown-option paths. Done means help, usage, and short aliases exit 0 with usage text on stdout, no stderr output, and focused regression coverage passes on both backends.

Written by the indexing model from the issue text.

Description

bug

Summary

MooseX::Getopt 0.78 loses help/usage text when help processing exits under PerlOnJava. The failure reproduces on both the JVM and interpreter backends.

Reproduction

This was reported by CPAN random tester run 20260916-111623-23683 in the MooseX::Getopt::Dashes request block. The affected upstream tests are:

t/104_override_usage.t
t/109_help_flag.t

The complete PerlOnJava run reports:

Files=29, Tests=339
9 subtests failed

Focused execution of both affected tests reproduces the same failures on both PerlOnJava backends.

Observed behavior

t/104_override_usage.t fails four assertions. With --help, and with the before/after usage-text modifiers, the captured stdout is empty. The unknown-option case still prints usage successfully.

t/109_help_flag.t fails five assertions. Each of these flags exits with status 0 but produces empty captured stdout:

--help
--usage
--?
-?
-h

The test still observes the expected exit status and no stderr output. Ordinary option parsing and the rest of the distribution’s tests pass.

Expected behavior

System Perl passes the complete upstream suite:

Files=29, Tests=339
All tests successful.

For each help flag, the usage object’s text should be written to stdout before the process exits successfully.

Analysis

This does not appear to be a MooseX::Getopt option-parsing defect: regular options and unknown-option usage output work, and system Perl passes the same tests. The common failure is that help handling calls an otherwise successful exit while the text expected by Test::Trap is absent from captured stdout.

The likely area is shared PerlOnJava handling of stdout buffering/flush behavior around exit, or interaction between that behavior and Test::Trap’s local output capture. The issue affects both execution backends, indicating shared runtime or bundled-library behavior.

Impact

Applications using MooseX::Getopt’s built-in help flags can terminate successfully without displaying their usage information, making command-line interfaces unusable or misleading on PerlOnJava.

Suggested regression coverage

Add a focused project-owned test that invokes a MooseX::Getopt class under both backends with --help (and one short alias), verifies exit status 0, and asserts that the generated usage text is present on stdout and absent from stderr. Also cover output flushing when a successful exit occurs inside a captured-output scope.

Dominant language
Perl
Stars
64
Forks
6
Avg merge
5h 11m
Merged PRs (30d)
168

Contributor guide

Open the contributing guide

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 fglock/PerlOnJava

All issues in fglock/PerlOnJava

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.