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