-
package MooseX::Getopt;
use Moose::Role;
-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.25';
+our $AUTHORITY = 'cpan:STEVAN';
-with @roles;
+with _HAVE_GLD ? 'MooseX::Getopt::GLD' : 'MooseX::Getopt::Basic';
no Moose::Role; 1;
By default, attributes which start with an underscore are not given
commandline argument support, unless the attribute's metaclass is set
-to L<MooseX::Getopt::Meta::Attribute>. If you don't want you accessors
-to have the leading underscore in thier name, you can do this:
+to L<MooseX::Getopt::Meta::Attribute>. 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', ...);
params from the command line (possibly overriding those in C<%params>)
and then return a newly constructed object.
-The special parameter C<argv>, if specified should point to an array
+The special parameter C<argv>, if specified should point to an array
reference with an array to use instead of C<@ARGV>.
-The paramater C<disable_gld>, if specified and a true value will disable
-the use of L<Getopt::Long::Descriptive> .
-
If L<Getopt::Long/GetOptions> fails (due to invalid arguments),
C<new_with_options> will throw an exception.
--help
--usage
-If you have L<Getopt::Long::Descriptive> a the C<usage> param is also passed to
+If you have L<Getopt::Long::Descriptive> the C<usage> param is also passed to
C<new>.
=item B<ARGV>
This returns the role meta object.
-=item B<HAVE_GLD>
-
-A constant for internal use.
-
=back
=head1 BUGS
Drew Taylor, E<lt>drew@drewtaylor.comE<gt>
+Tomas Doran, (t0m) C<< <bobtfish@bobtfish.net> >>
+
=head1 COPYRIGHT AND LICENSE
Copyright 2007-2008 by Infinity Interactive, Inc.