line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Driver::Help; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
146
|
use Modern::Perl; |
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
203
|
|
4
|
18
|
|
|
18
|
|
3383
|
use Moose; |
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
138
|
|
5
|
18
|
|
|
18
|
|
127003
|
use namespace::autoclean; |
|
18
|
|
|
|
|
48
|
|
|
18
|
|
|
|
|
210
|
|
6
|
18
|
|
|
18
|
|
1732
|
use Kavorka '-all'; |
|
18
|
|
|
|
|
54
|
|
|
18
|
|
|
|
|
190
|
|
7
|
18
|
|
|
18
|
|
73457
|
use Data::Printer alias => 'pdump'; |
|
18
|
|
|
|
|
51
|
|
|
18
|
|
|
|
|
225
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with |
10
|
|
|
|
|
|
|
'CLI::Driver::CommonRole'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
############################### |
13
|
|
|
|
|
|
|
###### PUBLIC ATTRIBUTES ###### |
14
|
|
|
|
|
|
|
############################### |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#has desc => ( is => 'rw' ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has args => ( |
19
|
|
|
|
|
|
|
is => 'rw', |
20
|
|
|
|
|
|
|
isa => 'HashRef[Str]', |
21
|
|
|
|
|
|
|
default => sub { {} } |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has examples => ( |
25
|
|
|
|
|
|
|
is => 'rw', |
26
|
|
|
|
|
|
|
isa => 'ArrayRef[Str]', |
27
|
|
|
|
|
|
|
default => sub { [] } |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
18
|
50
|
33
|
18
|
|
85620
|
method parse (HashRef|Undef :$href!) { |
|
18
|
50
|
33
|
18
|
|
62
|
|
|
18
|
50
|
|
18
|
|
2575
|
|
|
18
|
50
|
|
18
|
|
135
|
|
|
18
|
50
|
|
18
|
|
52
|
|
|
18
|
50
|
|
272
|
|
1075
|
|
|
18
|
|
|
|
|
153
|
|
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
195
|
|
|
18
|
|
|
|
|
2354
|
|
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
7010
|
|
|
18
|
|
|
|
|
156
|
|
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
4746
|
|
|
272
|
|
|
|
|
697
|
|
|
272
|
|
|
|
|
477
|
|
|
272
|
|
|
|
|
423
|
|
|
272
|
|
|
|
|
847
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
434
|
|
|
272
|
|
|
|
|
581
|
|
|
272
|
|
|
|
|
736
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
691
|
|
|
272
|
|
|
|
|
566
|
|
|
272
|
|
|
|
|
995
|
|
|
272
|
|
|
|
|
725
|
|
|
272
|
|
|
|
|
440
|
|
|
272
|
|
|
|
|
734
|
|
|
272
|
|
|
|
|
1410
|
|
|
272
|
|
|
|
|
795
|
|
|
272
|
|
|
|
|
794
|
|
|
272
|
|
|
|
|
408
|
|
|
272
|
|
|
|
|
1311
|
|
|
272
|
|
|
|
|
400
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Don't fail if no help provided. |
33
|
272
|
100
|
|
|
|
952
|
return 1 if !defined $href; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# self->args |
36
|
17
|
50
|
|
|
|
86
|
if( exists $href->{args} ){ |
37
|
17
|
|
|
|
|
48
|
$self->args( { %{$href->{args}} } ); |
|
17
|
|
|
|
|
669
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# self->examples |
41
|
17
|
50
|
|
|
|
89
|
if( exists $href->{examples} ){ |
42
|
17
|
|
|
|
|
42
|
$self->examples( [ @{$href->{examples}} ] ); |
|
17
|
|
|
|
|
625
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
17
|
|
|
|
|
80
|
return 1; # success |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
18
|
50
|
|
18
|
|
43118
|
method has_help (Str $arg) { |
|
18
|
50
|
|
18
|
|
59
|
|
|
18
|
50
|
|
5
|
|
3636
|
|
|
18
|
50
|
|
|
|
151
|
|
|
18
|
50
|
|
|
|
49
|
|
|
18
|
|
|
|
|
2349
|
|
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
9
|
|
49
|
|
|
|
|
|
|
|
50
|
5
|
50
|
|
|
|
131
|
if( exists $self->args->{$arg} ){ |
51
|
5
|
|
|
|
|
15
|
return 1; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
0
|
return 0; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
18
|
0
|
|
18
|
|
41855
|
method get_usage (Str $arg) { |
|
18
|
0
|
|
18
|
|
48
|
|
|
18
|
0
|
|
0
|
|
3242
|
|
|
18
|
0
|
|
|
|
147
|
|
|
18
|
0
|
|
|
|
40
|
|
|
18
|
|
|
|
|
1820
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
0
|
return $self->get_help($arg); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
18
|
50
|
|
18
|
|
40728
|
method get_help (Str $arg) { |
|
18
|
50
|
|
18
|
|
81
|
|
|
18
|
50
|
|
5
|
|
3434
|
|
|
18
|
50
|
|
|
|
138
|
|
|
18
|
50
|
|
|
|
39
|
|
|
18
|
|
|
|
|
2823
|
|
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
31
|
|
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
7
|
|
63
|
|
|
|
|
|
|
|
64
|
5
|
50
|
|
|
|
14
|
if ($self->has_help($arg)) { |
65
|
5
|
|
|
|
|
120
|
return $self->args->{$arg}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
0
|
return ""; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
18
|
50
|
|
18
|
|
21429
|
method has_examples { |
|
18
|
|
|
1
|
|
48
|
|
|
18
|
|
|
|
|
3856
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
72
|
|
|
|
|
|
|
|
73
|
1
|
50
|
|
|
|
2
|
if( @{$self->examples} ){ |
|
1
|
|
|
|
|
62
|
|
74
|
1
|
|
|
|
|
11
|
return 1; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return 0; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |