use OO syntax for handling subref
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / ProcessedArgv.pm
CommitLineData
f3615693 1package MooseX::Getopt::ProcessedArgv;
2use Moose;
c4ffa938 3# ABSTRACT: MooseX::Getopt::ProcessedArgv - Class containing the results of process_argv
f3615693 4
5has 'argv_copy' => (is => 'ro', isa => 'ArrayRef');
6has 'extra_argv' => (is => 'ro', isa => 'ArrayRef');
7has 'usage' => (is => 'ro', isa => 'Maybe[Object]');
8has 'constructor_params' => (is => 'ro', isa => 'HashRef');
9has 'cli_params' => (is => 'ro', isa => 'HashRef');
10
db2a6470 11no Moose;
12
f3615693 13__PACKAGE__->meta->make_immutable();
14
151;
16
f3615693 17=head1 SYNOPSIS
18
19 use My::App;
20
21 my $pa = My::App->process_argv(@params);
22 my $argv_copy = $pa->argv_copy();
23 my $extra_argv = $pa->extra_argv();
24 my $usage = $pa->usage();
25 my $constructor_params = $pa->constructor_params();
26 my $cli_params = $pa->cli_params();
27
28=head1 DESCRIPTION
29
30This object contains the result of a L<MooseX::Getopt/process_argv> call. It
31contains all the information that L<MooseX::Getopt/new_with_options> uses
32when calling new.
33
e8e1e4b3 34=method argv_copy
f3615693 35
36Reference to a copy of the original C<@ARGV> array as it originally existed
37at the time of C<new_with_options>.
38
e8e1e4b3 39=method extra_arg
f3615693 40
41Arrayref of leftover C<@ARGV> elements that L<Getopt::Long> did not parse.
42
e8e1e4b3 43=method usage
f3615693 44
45Contains the L<Getopt::Long::Descriptive::Usage> object (if
46L<Getopt::Long::Descriptive> is used).
47
e8e1e4b3 48=method constructor_params
f3615693 49
50Parameters passed to process_argv.
51
e8e1e4b3 52=method cli_param
f3615693 53
54Command-line parameters parsed out of C<@ARGV>.
55
f3615693 56=cut