MooseX::Getopt help exits without printing usage text
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
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
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 fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:runtime enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1494 ·
-
area:backend area:runtime enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1492 ·
-
area:parser bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
fglock/PerlOnJava#1491 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
fglock/PerlOnJava#1487 ·
All issues in fglock/PerlOnJava
Similar issues
-
documentation Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objectionary/eolang.sty#159 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
corazawaf/coraza-nginx#140 · 4 comments ·
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100