X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FGetopt.pm;h=8907942e715b4560d3cb0b9c4c2d3bc1cc6054bd;hb=b766829d7cc3432721907f957291cdc3edd56e61;hp=85747e540c72768f4f5f27a313b3418145bd4415;hpb=630657d529277b7fb600febf001d8667d8e85184;p=gitmo%2FMooseX-Getopt.git diff --git a/lib/MooseX/Getopt.pm b/lib/MooseX/Getopt.pm index 85747e5..8907942 100644 --- a/lib/MooseX/Getopt.pm +++ b/lib/MooseX/Getopt.pm @@ -11,7 +11,7 @@ use Carp (); use Getopt::Long (); # GLD uses it anyway, doesn't hurt use constant HAVE_GLD => not not eval { require Getopt::Long::Descriptive }; -our $VERSION = '0.14'; +our $VERSION = '0.18'; our $AUTHORITY = 'cpan:STEVAN'; has ARGV => (is => 'rw', isa => 'ArrayRef', metaclass => "NoGetopt"); @@ -164,7 +164,7 @@ sub _compute_getopt_attrs { $_->name !~ /^_/ } grep { !$_->does('MooseX::Getopt::Meta::Attribute::Trait::NoGetopt') - } $class->meta->compute_all_applicable_attributes + } $class->meta->get_all_attributes } sub _get_cmd_flags_for_attr { @@ -194,9 +194,9 @@ sub _attrs_to_options { my $opt_string = join(q{|}, $flag, @aliases); if ($attr->has_type_constraint) { - my $type_name = $attr->type_constraint->name; - if (MooseX::Getopt::OptionTypeMap->has_option_type($type_name)) { - $opt_string .= MooseX::Getopt::OptionTypeMap->get_option_type($type_name) + my $type = $attr->type_constraint; + if (MooseX::Getopt::OptionTypeMap->has_option_type($type)) { + $opt_string .= MooseX::Getopt::OptionTypeMap->get_option_type($type) } } @@ -276,8 +276,8 @@ to have C ignore your attribute in the commandline options. By default, attributes which start with an underscore are not given commandline argument support, unless the attribute's metaclass is set -to L. If you don't want you accessors -to have the leading underscore in thier name, you can do this: +to L. If you don't want your accessors +to have the leading underscore in their name, you can do this: # for read/write attributes has '_foo' => (accessor => 'foo', ...); @@ -417,7 +417,7 @@ and then return a newly constructed object. If L fails (due to invalid arguments), C will throw an exception. -If you have L a the C param is also passed to +If you have L the C param is also passed to C. =item B