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