Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

MooseX::Getopt help exits without printing usage text

Đang mở
#1,421 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
perl
Lĩnh vực
cli, testing-qa

Hướng nghiên cứu

Chạy t/104_override_usage.t và t/109_help_flag.t trên cả hai backend PerlOnJava, sau đó truy vết việc đệm stdout dùng chung hoặc việc capture bằng Test::Trap xung quanh lần thoát thành công. So sánh các đường dẫn help và tùy chọn không xác định. Hoàn tất khi help, usage và các alias ngắn thoát với exit 0, văn bản usage được ghi ra stdout, không có đầu ra stderr và phạm vi kiểm thử hồi quy tập trung đều đạt trên cả hai backend.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Perl
Star
64
Fork
7
Merge trung bình
5 giờ 8 phút
Pull request đã merge (30 ngày)
193

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fglock/PerlOnJava

Tất cả issue của fglock/PerlOnJava

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.