line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Driver::Help; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
151
|
use Modern::Perl; |
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
230
|
|
4
|
18
|
|
|
18
|
|
3435
|
use Moose; |
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
146
|
|
5
|
18
|
|
|
18
|
|
129438
|
use namespace::autoclean; |
|
18
|
|
|
|
|
55
|
|
|
18
|
|
|
|
|
207
|
|
6
|
18
|
|
|
18
|
|
1750
|
use Kavorka '-all'; |
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
180
|
|
7
|
18
|
|
|
18
|
|
75197
|
use Data::Printer alias => 'pdump'; |
|
18
|
|
|
|
|
53
|
|
|
18
|
|
|
|
|
230
|
|
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
|
|
88108
|
method parse (HashRef|Undef :$href!) { |
|
18
|
50
|
33
|
18
|
|
58
|
|
|
18
|
50
|
|
18
|
|
2742
|
|
|
18
|
50
|
|
18
|
|
139
|
|
|
18
|
50
|
|
18
|
|
65
|
|
|
18
|
50
|
|
272
|
|
1104
|
|
|
18
|
|
|
|
|
151
|
|
|
18
|
|
|
|
|
52
|
|
|
18
|
|
|
|
|
188
|
|
|
18
|
|
|
|
|
2479
|
|
|
18
|
|
|
|
|
56
|
|
|
18
|
|
|
|
|
7076
|
|
|
18
|
|
|
|
|
231
|
|
|
18
|
|
|
|
|
57
|
|
|
18
|
|
|
|
|
4561
|
|
|
272
|
|
|
|
|
710
|
|
|
272
|
|
|
|
|
539
|
|
|
272
|
|
|
|
|
418
|
|
|
272
|
|
|
|
|
856
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
443
|
|
|
272
|
|
|
|
|
552
|
|
|
272
|
|
|
|
|
743
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
635
|
|
|
272
|
|
|
|
|
527
|
|
|
272
|
|
|
|
|
971
|
|
|
272
|
|
|
|
|
775
|
|
|
272
|
|
|
|
|
444
|
|
|
272
|
|
|
|
|
768
|
|
|
272
|
|
|
|
|
1511
|
|
|
272
|
|
|
|
|
789
|
|
|
272
|
|
|
|
|
685
|
|
|
272
|
|
|
|
|
416
|
|
|
272
|
|
|
|
|
1219
|
|
|
272
|
|
|
|
|
387
|
|
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
|
|
|
|
111
|
if( exists $href->{args} ){ |
37
|
17
|
|
|
|
|
63
|
$self->args( { %{$href->{args}} } ); |
|
17
|
|
|
|
|
733
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# self->examples |
41
|
17
|
50
|
|
|
|
88
|
if( exists $href->{examples} ){ |
42
|
17
|
|
|
|
|
46
|
$self->examples( [ @{$href->{examples}} ] ); |
|
17
|
|
|
|
|
690
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
17
|
|
|
|
|
91
|
return 1; # success |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
18
|
50
|
|
18
|
|
42088
|
method has_help (Str $arg) { |
|
18
|
50
|
|
18
|
|
59
|
|
|
18
|
50
|
|
5
|
|
3746
|
|
|
18
|
50
|
|
|
|
203
|
|
|
18
|
50
|
|
|
|
70
|
|
|
18
|
|
|
|
|
2441
|
|
|
5
|
|
|
|
|
25
|
|
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
7
|
|
49
|
|
|
|
|
|
|
|
50
|
5
|
50
|
|
|
|
144
|
if( exists $self->args->{$arg} ){ |
51
|
5
|
|
|
|
|
16
|
return 1; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
0
|
return 0; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
18
|
0
|
|
18
|
|
41077
|
method get_usage (Str $arg) { |
|
18
|
0
|
|
18
|
|
54
|
|
|
18
|
0
|
|
0
|
|
3360
|
|
|
18
|
0
|
|
|
|
147
|
|
|
18
|
0
|
|
|
|
47
|
|
|
18
|
|
|
|
|
1749
|
|
|
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
|
|
40352
|
method get_help (Str $arg) { |
|
18
|
50
|
|
18
|
|
84
|
|
|
18
|
50
|
|
5
|
|
3395
|
|
|
18
|
50
|
|
|
|
146
|
|
|
18
|
50
|
|
|
|
71
|
|
|
18
|
|
|
|
|
2694
|
|
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
43
|
|
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
7
|
|
63
|
|
|
|
|
|
|
|
64
|
5
|
50
|
|
|
|
18
|
if ($self->has_help($arg)) { |
65
|
5
|
|
|
|
|
115
|
return $self->args->{$arg}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
0
|
return ""; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
18
|
50
|
|
18
|
|
21580
|
method has_examples { |
|
18
|
|
|
1
|
|
44
|
|
|
18
|
|
|
|
|
3799
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
72
|
|
|
|
|
|
|
|
73
|
1
|
50
|
|
|
|
2
|
if( @{$self->examples} ){ |
|
1
|
|
|
|
|
29
|
|
74
|
1
|
|
|
|
|
8
|
return 1; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return 0; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |