X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FGetopt.pm;h=e8b6812911a252ca4ea03a4019e26f9de5c85fcd;hb=04dc08522cab0990311c92bf4b6bbfdde8be240b;hp=d8b5d2bc097bb184c69a9fec1a011b654affad17;hpb=ed3bf9a5b6a09a361b133ac12bb07775d12e4f14;p=gitmo%2FMooseX-Getopt.git diff --git a/lib/MooseX/Getopt.pm b/lib/MooseX/Getopt.pm index d8b5d2b..e8b6812 100644 --- a/lib/MooseX/Getopt.pm +++ b/lib/MooseX/Getopt.pm @@ -1,16 +1,12 @@ - package MooseX::Getopt; use Moose::Role; -our $VERSION = '0.20'; -our $AUTHORITY = 'cpan:STEVAN'; - -use constant HAVE_GLD => not not eval { require Getopt::Long::Descriptive }; +use constant _HAVE_GLD => not not eval { require Getopt::Long::Descriptive }; -my @roles = ('MooseX::Getopt::Basic'); -if (HAVE_GLD()) { push @roles, 'MooseX::Getopt::GLD' } +our $VERSION = '0.27'; +our $AUTHORITY = 'cpan:STEVAN'; -with @roles; +with _HAVE_GLD ? 'MooseX::Getopt::GLD' : 'MooseX::Getopt::Basic'; no Moose::Role; 1; @@ -67,8 +63,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', ...); @@ -205,7 +201,7 @@ This method will take a set of default C<%params> and then collect params from the command line (possibly overriding those in C<%params>) and then return a newly constructed object. -The special parameter C, if specified should point to an array +The special parameter C, if specified should point to an array reference with an array to use instead of C<@ARGV>. If L fails (due to invalid arguments), @@ -220,7 +216,7 @@ B option for each attribute to document. --help --usage -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 @@ -238,10 +234,6 @@ un-mangled. This returns the role meta object. -=item B - -A constant for internal use. - =back =head1 BUGS @@ -264,6 +256,8 @@ Ryan D Johnson, Eryan@innerfence.comE Drew Taylor, Edrew@drewtaylor.comE +Tomas Doran, (t0m) C<< >> + =head1 COPYRIGHT AND LICENSE Copyright 2007-2008 by Infinity Interactive, Inc.