Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: olaf [...] wundersolutions.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.65
Fixed in: 0.69



Subject: init_arg is ignored
MooseX::GetOpt seems to be ignoring init_arg. Running the sample script without args demonstrates that init_arg is being ignored. I've also got a gist for the same example here https://gist.github.com/oalders/e8dd74c0cf19744aed39
Subject: init-arg.pl
package Foo; use Moose; with 'MooseX::Getopt'; has foo => ( is => 'ro', isa => 'Int', init_arg => 'bar', required => 1, documentation => 'foo has init_arg of bar', ); sub run { my $self = shift; print $self->foo; } __PACKAGE__->meta->make_immutable(); 1; package main; Foo->new_with_options->run();
On 2014-08-07 14:52:05, OALDERS wrote: Show quoted text
> MooseX::GetOpt seems to be ignoring init_arg. Running the sample > script without args demonstrates that init_arg is being ignored. I've > also got a gist for the same example here > https://gist.github.com/oalders/e8dd74c0cf19744aed39
Yup, looks like a design oversight. An attribute's init_arg is only looked at for the 'configfile' attribute, when combined with MooseX::ConfigFromFile.
PR#6 is released in 0.69. Thanks!