Skip Menu |

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

Report information
The Basics
Id: 119091
Status: open
Priority: 0/
Queue: MooseX-Getopt

People
Owner: Nobody in particular
Requestors: pcronin [...] maxmind.com
Cc:
AdminCc:

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



Subject: Required attributes are demanded when usage requested
Date: Thu, 1 Dec 2016 12:00:13 -0500
To: bug-MooseX-Getopt [...] rt.cpan.org
From: Patrick Cronin <pcronin [...] maxmind.com>
Hello, I love MooseX-Getopt, and thanks for making and maintaining it! However, I think I’ve found a small bug. Using: perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level Distribution: ETHER/MooseX-Getopt-0.71 (and also 0.59) OS: Darwin gwana 15.6.0 Darwin Kernel Version 15.6.0: Thu Sep 1 15:01:16 PDT 2016; root:xnu-3248.60.11~2/RELEASE_X86_64 x86_64 With the following simple program in `test.pl`: -------- #!/usr/bin/perl package A; use Moose; with 'MooseX::Getopt'; has an_option => ( is => 'ro', isa => 'Str', required => 1, ); __PACKAGE__->meta->make_immutable; 1; package main; use strict; use warnings; use A; A->new_with_options()->run; -------- I’d expect to be able to run: $ ./test.pl -h And see only usage. Instead, it first emits an error demanding the “an_option” parameter, and then it displays the usage. -------- $ ./test.pl --help Mandatory parameter 'an_option' missing in call to (eval) usage: test.pl [-?h] [long options...] -h -? --usage --help Prints this usage information. --an_option -------- Thanks, -Patrick
On 2016-12-01 09:00:27, pcronin@maxmind.com wrote: Show quoted text
> Hello, > > I love MooseX-Getopt, and thanks for making and maintaining it! > However, I think I’ve found a small bug.
We can't really do anything about this without significant rearchitecting, since the object must be instantiated first before the usage data is constructed. At least you got the usage information *as well* as the bug, instead of just the error about the missing attribute? :)
Subject: Re: [rt.cpan.org #119091] Required attributes are demanded when usage requested
Date: Thu, 1 Dec 2016 12:17:05 -0500
To: bug-MooseX-Getopt [...] rt.cpan.org
From: Patrick Cronin <pcronin [...] maxmind.com>
Indeed, the usage appearing makes it a tiny issue and not mission critical. Thanks! Show quoted text
> On Dec 1, 2016, at 12:12 PM, Karen Etheridge via RT <bug-MooseX-Getopt@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=119091 > > > On 2016-12-01 09:00:27, pcronin@maxmind.com wrote:
>> Hello, >> >> I love MooseX-Getopt, and thanks for making and maintaining it! >> However, I think I’ve found a small bug.
> > We can't really do anything about this without significant rearchitecting, > since the object must be instantiated first before the usage data is > constructed. > > At least you got the usage information *as well* as the bug, instead of > just the error about the missing attribute? :) > >