* Add current $VERSION to all files.
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Parser / Default.pm
1
2 package MooseX::Getopt::Parser::Default;
3
4 our $VERSION   = '0.150001';
5
6 use Moose;
7
8 use MooseX::Getopt::Parser::Long;
9 use maybe 'MooseX::Getopt::Parser::Descriptive';
10
11
12 sub new {
13     my $class = shift;
14     return maybe::HAVE_MOOSEX_GETOPT_PARSER_DESCRIPTIVE
15            ? MooseX::Getopt::Parser::Descriptive->new(@_)
16            : MooseX::Getopt::Parser::Long->new(@_);
17 };
18
19
20 1;
21
22
23 __END__
24
25 =pod
26
27 =head1 NAME
28
29 MooseX::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
41 This class contains the factory method which returns new
42 L<MooseX::Getopt::Parser> object.  The object's class is
43 L<MooseX::Getopt::Parser::Descriptive> if L<Getopt::Long::Descriptive>
44 module exists or L<MooseX::Getopt::Parser::Long> otherwise.
45
46 =head1 METHODS
47
48 =over 4
49
50 =item B<new (%params)>
51
52 This is the factory method which returns new L<MooseX::Getopt::Parser>
53 object.  All C<%params> are passed to new object.
54
55 =back
56
57 =head1 BUGS
58
59 All complex software has bugs lurking in it, and this module is no
60 exception. If you find a bug please either email me, or add the bug
61 to 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
77 Piotr Roszatycki, E<lt>dexter@cpan.orgE<gt>
78
79 =head1 COPYRIGHT AND LICENSE
80
81 Copyright 2007-2008 by Infinity Interactive, Inc.
82
83 L<http://www.iinteractive.com>
84
85 This library is free software; you can redistribute it and/or modify
86 it under the same terms as Perl itself.
87
88 =cut