Revision history for Perl extension MooseX-Getopt
+0.11 Sun. Jan. 27, 2008
+ * MooseX::Getopt
+ - Commandline option shouldn't be required in the
+ case that the given "required" attribute has
+ a default or a builder method.
+
0.10 Wed. Jan. 23, 2008
* MooseX::Getopt
- Support default configfile attribute when
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");
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 ) : () ),
}