Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

MooseX::Getopt help exits without printing usage text

未关闭
#1,421 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
perl
领域
cli, testing-qa

调研方向

在两个 PerlOnJava 后端上运行 t/104_override_usage.t 和 t/109_help_flag.t,然后跟踪成功退出时共享的 stdout 缓冲或 Test::Trap 捕获。比较帮助和未知选项路径。完成的标准是:help、usage 和短别名以 exit 0 退出,usage 文本输出到 stdout,没有 stderr 输出,并且聚焦的回归覆盖在两个后端上都通过。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Perl
星标
64
派生
7
平均合并
5 小时 8 分钟
30 天内合并 PR
193

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

fglock/PerlOnJava 的其他 Issue

查看 fglock/PerlOnJava 的全部 Issue

相似的 Issue

更多 Perl Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。