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