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