X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FGetopt.pm;h=ddbba8cc3352d339cb15d15ff8a40c6ead197d55;hb=6c329add9865bff293ea15cb1ce1c3478bb50d4d;hp=d7898f779b86ae55198e0f81d7cd39657f866a5c;hpb=b4a7905195bf50b95248815d2cfe5a762d8986b5;p=gitmo%2FMooseX-Getopt.git diff --git a/lib/MooseX/Getopt.pm b/lib/MooseX/Getopt.pm index d7898f7..ddbba8c 100644 --- a/lib/MooseX/Getopt.pm +++ b/lib/MooseX/Getopt.pm @@ -9,7 +9,7 @@ use MooseX::Getopt::Meta::Attribute::NoGetopt; use Getopt::Long (); # GLD uses it anyway, doesn't hurt use constant HAVE_GLD => not not eval { require Getopt::Long::Descriptive }; -our $VERSION = '0.10'; +our $VERSION = '0.11'; our $AUTHORITY = 'cpan:STEVAN'; has ARGV => (is => 'rw', isa => 'ArrayRef', metaclass => "NoGetopt"); @@ -175,7 +175,7 @@ sub _attrs_to_options { name => $name, init_arg => $attr->init_arg, opt_string => $opt_string, - required => $attr->is_required, + required => $attr->is_required && !$attr->has_default && !$attr->has_builder, ( ( $attr->has_default && ( $attr->is_default_a_coderef xor $attr->is_lazy ) ) ? ( default => $attr->default({}) ) : () ), ( $attr->has_documentation ? ( doc => $attr->documentation ) : () ), }