
package MooseX::Getopt::Parser::Default;

our $VERSION   = '0.150001';

use Moose;

use MooseX::Getopt::Parser::Long;
use maybe 'MooseX::Getopt::Parser::Descriptive';


sub new {
    my $class = shift;
    return maybe::HAVE_MOOSEX_GETOPT_PARSER_DESCRIPTIVE
           ? MooseX::Getopt::Parser::Descriptive->new(@_)
           : MooseX::Getopt::Parser::Long->new(@_);
};


1;


__END__

=pod

=head1 NAME

MooseX::Getopt::Parser::Default - A default parser for MooseX::Getopt

=head1 SYNOPSIS

  use MooseX::Getopt::Parser::Default;

  my $parser = MooseX::Getopt::Parser::Default->new( config => ['pass_through'] );
  my $getopt = MooseX::Getopt::Session->new( parser => $parser );
  my $app = My::App->new( getopt => $getopt );

=head1 DESCRIPTION

This class contains the factory method which returns new
L<MooseX::Getopt::Parser> object.  The object's class is
L<MooseX::Getopt::Parser::Descriptive> if L<Getopt::Long::Descriptive>
module exists or L<MooseX::Getopt::Parser::Long> otherwise.

=head1 METHODS

=over 4

=item B<new (%params)>

This is the factory method which returns new L<MooseX::Getopt::Parser>
object.  All C<%params> are passed to new object.

=back

=head1 BUGS

All complex software has bugs lurking in it, and this module is no
exception. If you find a bug please either email me, or add the bug
to cpan-RT.

=head1 SEE ALSO

=over 4

=item L<MooseX::Getopt::Parser>

=item L<MooseX::Getopt::Parser::Long>

=item L<MooseX::Getopt::Parser::Descriptive>

=back

=head1 AUTHOR

Piotr Roszatycki, E<lt>dexter@cpan.orgE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright 2007-2008 by Infinity Interactive, Inc.

L<http://www.iinteractive.com>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut
