5fac8d9dbb33b56ebbf09e71cd2cd9b9fdb3cd23
[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 no Moose;
11
12 __PACKAGE__->meta->make_immutable();
13
14 1;
15
16 =head1 SYNOPSIS
17
18   use My::App;
19
20   my $pa = My::App->process_argv(@params);
21   my $argv_copy          = $pa->argv_copy();
22   my $extra_argv         = $pa->extra_argv();
23   my $usage              = $pa->usage();
24   my $constructor_params = $pa->constructor_params();
25   my $cli_params         = $pa->cli_params();
26
27 =head1 DESCRIPTION
28
29 This object contains the result of a L<MooseX::Getopt/process_argv> call. It
30 contains all the information that L<MooseX::Getopt/new_with_options> uses
31 when calling new.
32
33 =method argv_copy
34
35 Reference to a copy of the original C<@ARGV> array as it originally existed
36 at the time of C<new_with_options>.
37
38 =method extra_arg
39
40 Arrayref of leftover C<@ARGV> elements that L<Getopt::Long> did not parse.
41
42 =method usage
43
44 Contains the L<Getopt::Long::Descriptive::Usage> object (if
45 L<Getopt::Long::Descriptive> is used).
46
47 =method constructor_params
48
49 Parameters passed to process_argv.
50
51 =method cli_param
52
53 Command-line parameters parsed out of C<@ARGV>.
54
55 =cut