move most of new_with_options logic into separate publically accessible process_argv...
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / ProcessedArgv.pm
1 package MooseX::Getopt::ProcessedArgv;
2 use Moose;
3
4 has 'argv_copy'          => (is => 'ro', isa => 'ArrayRef');
5 has 'extra_argv'         => (is => 'ro', isa => 'ArrayRef');
6 has 'usage'              => (is => 'ro', isa => 'Maybe[Object]');
7 has 'constructor_params' => (is => 'ro', isa => 'HashRef');
8 has 'cli_params'         => (is => 'ro', isa => 'HashRef');
9
10 __PACKAGE__->meta->make_immutable();
11
12 1;
13
14 =pod
15
16 =encoding utf-8
17
18 =head1 NAME
19
20 MooseX::Getopt::ProcessedArgv - contains result of process_argv
21
22 =head1 SYNOPSIS
23
24   use My::App;
25
26   my $pa = My::App->process_argv(@params);
27   my $argv_copy          = $pa->argv_copy();
28   my $extra_argv         = $pa->extra_argv();
29   my $usage              = $pa->usage();
30   my $constructor_params = $pa->constructor_params();
31   my $cli_params         = $pa->cli_params();
32
33 =head1 DESCRIPTION
34
35 This object contains the result of a L<MooseX::Getopt/process_argv> call. It
36 contains all the information that L<MooseX::Getopt/new_with_options> uses
37 when calling new.
38
39 =head1 METHODS
40
41 =over
42
43 =item argv_copy
44
45 Reference to a copy of the original C<@ARGV> array as it originally existed
46 at the time of C<new_with_options>.
47
48 =item extra_arg
49
50 Arrayref of leftover C<@ARGV> elements that L<Getopt::Long> did not parse.
51
52 =item usage    
53
54 Contains the L<Getopt::Long::Descriptive::Usage> object (if
55 L<Getopt::Long::Descriptive> is used).
56
57 =item constructor_params
58
59 Parameters passed to process_argv.
60
61 =item cli_param
62
63 Command-line parameters parsed out of C<@ARGV>.
64
65 =back
66
67 =head1 AUTHOR
68
69 Stevan Little E<lt>stevan@iinteractive.comE<gt>
70
71 Brandon L. Black, E<lt>blblack@gmail.comE<gt>
72
73 Yuval Kogman, E<lt>nothingmuch@woobling.orgE<gt>
74
75 =head1 CONTRIBUTORS
76
77 Ryan D Johnson, E<lt>ryan@innerfence.comE<gt>
78
79 Drew Taylor, E<lt>drew@drewtaylor.comE<gt>
80
81 Tomas Doran, (t0m) C<< <bobtfish@bobtfish.net> >>
82
83 =head1 COPYRIGHT AND LICENSE
84
85 This software is copyright (c) 2010 by Infinity Interactive, Inc.
86
87 This is free software; you can redistribute it and/or modify it under
88 the same terms as the Perl 5 programming language system itself.
89
90 =cut