* Perltidy.
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Parser / Default.pm
CommitLineData
ac2073c8 1
2package MooseX::Getopt::Parser::Default;
3
4use Moose;
5
6use MooseX::Getopt::Parser::Long;
7use maybe 'MooseX::Getopt::Parser::Descriptive';
8
9
10sub new {
11 my $class = shift;
12 return maybe::HAVE_MOOSEX_GETOPT_PARSER_DESCRIPTIVE
c5c99e6b 13 ? MooseX::Getopt::Parser::Descriptive->new(@_)
14 : MooseX::Getopt::Parser::Long->new(@_);
ac2073c8 15};
16
17
181;
19
c5c99e6b 20
ac2073c8 21__END__
22
23=pod
24
25=head1 NAME
26
27MooseX::Getopt::Parser::Default - A default parser for MooseX::Getopt
28
29=head1 SYNOPSIS
30
31 use MooseX::Getopt::Parser::Default;
32
33 my $parser = MooseX::Getopt::Parser::Default->new( config => ['pass_through'] );
34 my $getopt = MooseX::Getopt::Session->new( parser => $parser );
35 my $app = My::App->new( getopt => $getopt );
36
37=head1 DESCRIPTION
38
39This class contains the factory method which returns new
40L<MooseX::Getopt::Parser> object. The object's class is
41L<MooseX::Getopt::Parser::Descriptive> if L<Getopt::Long::Descriptive>
42module exists or L<MooseX::Getopt::Parser::Long> otherwise.
43
44=head1 METHODS
45
46=over 4
47
48=item B<new (%params)>
49
50This is the factory method which returns new L<MooseX::Getopt::Parser>
51object. All C<%params> are passed to new object.
52
53=back
54
55=head1 BUGS
56
57All complex software has bugs lurking in it, and this module is no
58exception. If you find a bug please either email me, or add the bug
59to cpan-RT.
60
61=head1 SEE ALSO
62
63=over 4
64
65=item L<MooseX::Getopt::Parser>
66
67=item L<MooseX::Getopt::Parser::Long>
68
69=item L<MooseX::Getopt::Parser::Descriptive>
70
71=back
72
73=head1 AUTHOR
74
75Piotr Roszatycki, E<lt>dexter@cpan.orgE<gt>
76
77=head1 COPYRIGHT AND LICENSE
78
79Copyright 2007-2008 by Infinity Interactive, Inc.
80
81L<http://www.iinteractive.com>
82
83This library is free software; you can redistribute it and/or modify
84it under the same terms as Perl itself.
85
86=cut