Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MooseX-Getopt-Usage CPAN distribution.

Report information
The Basics
Id: 77967
Status: resolved
Priority: 0/
Queue: MooseX-Getopt-Usage

People
Owner: PITCHLESS [...] cpan.org
Requestors: SILASMONK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: warning leaves one feeling uncomfortable
A simple test app gives the following error: nicholas@beaumont:~/debian/exp/moosex$ ./app2 --dry-run Use of uninitialized value in list assignment at /usr/share/perl5/MooseX/Getopt/Basic.pm line 135. The same app with just MooseX::Getopt has no such error. Both versions attached.
Subject: App2.pm
package App2; use Moose; with 'MooseX::Getopt::Usage'; has 'dry-run' => ( is => 'ro', isa => 'Bool', default => 0, documentation => qq{Just say what we would do; not actually do it.}, ); 1
Subject: app2
Download app2
application/octet-stream 89b

Message body not shown because it is not plain text.

Subject: App1.pm
package App1; use Moose; with 'MooseX::Getopt'; has 'dry-run' => ( is => 'ro', isa => 'Bool', default => 0, documentation => qq{Just say what we would do; not actually do it.}, ); 1
Subject: app1
Download app1
application/octet-stream 89b

Message body not shown because it is not plain text.

Thanks for the bug report, apologies for the slow response. Seeing the same thing here but the warning only shows for options with a - in their name. Changing the example to has 'dryrun' means I don't see the warning. Looking into this.
The problem here was using dashes in the has line of your class. This: has 'dry-run' => ( Wont work very well as the accessor method will not be callable due to the dash. It should be called dry_run. If you want that mapped to --dry-run on the command line just add a: with 'MooseX::Getopt::Dashes'; See: https://metacpan.org/module/MooseX::Getopt::Dashes