line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::CLI::Extension::Component::OriginalArgv; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
App::CLI::Extension::Component::OriginalArgv - for App::CLI::Extension original argv module |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
1.421 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
18
|
|
|
18
|
|
99
|
use strict; |
|
18
|
|
|
|
|
49
|
|
|
18
|
|
|
|
|
907
|
|
16
|
18
|
|
|
18
|
|
109
|
use base qw(Class::Accessor::Grouped); |
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
1489
|
|
17
|
18
|
|
|
18
|
|
16310
|
use FindBin qw($Bin $Script); |
|
18
|
|
|
|
|
22798
|
|
|
18
|
|
|
|
|
2598
|
|
18
|
18
|
|
|
18
|
|
119
|
use File::Spec; |
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
85
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '1.421'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
__PACKAGE__->mk_group_accessors(inherited => "_orig_argv", "argv0", "full_argv0"); |
23
|
|
|
|
|
|
|
__PACKAGE__->argv0($Script); |
24
|
|
|
|
|
|
|
__PACKAGE__->full_argv0(File::Spec->catfile($Bin, $Script)); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub orig_argv { |
28
|
|
|
|
|
|
|
|
29
|
18
|
|
|
18
|
0
|
455
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
18
|
|
|
|
|
42
|
my @array; |
32
|
18
|
100
|
66
|
|
|
189
|
if(scalar(@_) == 1 && ref($_[0]) eq "ARRAY"){ |
|
|
50
|
|
|
|
|
|
33
|
16
|
|
|
|
|
36
|
@array = @{$_[0]}; |
|
16
|
|
|
|
|
93
|
|
34
|
|
|
|
|
|
|
} elsif(scalar(@_) > 0) { |
35
|
0
|
|
|
|
|
0
|
@array = @_; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
18
|
100
|
|
|
|
79
|
if (scalar(@array) > 0) { |
39
|
16
|
|
|
|
|
651
|
$self->_orig_argv(\@array); |
40
|
|
|
|
|
|
|
} |
41
|
18
|
|
|
|
|
849
|
return $self->_orig_argv; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub cmdline { |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
1
|
0
|
19
|
my $self = shift; |
47
|
1
|
|
|
|
|
46
|
my $cmdline = join " ", $self->full_argv0, @{$self->orig_argv}; |
|
1
|
|
|
|
|
68
|
|
48
|
1
|
|
|
|
|
22
|
return $cmdline; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |