line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Driver::Help; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
130
|
use Modern::Perl; |
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
211
|
|
4
|
18
|
|
|
18
|
|
3208
|
use Moose; |
|
18
|
|
|
|
|
44
|
|
|
18
|
|
|
|
|
131
|
|
5
|
18
|
|
|
18
|
|
114968
|
use namespace::autoclean; |
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
187
|
|
6
|
18
|
|
|
18
|
|
1545
|
use Kavorka '-all'; |
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
150
|
|
7
|
18
|
|
|
18
|
|
66168
|
use Data::Printer alias => 'pdump'; |
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
200
|
|
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
|
|
77322
|
method parse (HashRef|Undef :$href!) { |
|
18
|
50
|
33
|
18
|
|
54
|
|
|
18
|
50
|
|
18
|
|
2256
|
|
|
18
|
50
|
|
18
|
|
124
|
|
|
18
|
50
|
|
18
|
|
37
|
|
|
18
|
50
|
|
272
|
|
947
|
|
|
18
|
|
|
|
|
114
|
|
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
167
|
|
|
18
|
|
|
|
|
2139
|
|
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
6353
|
|
|
18
|
|
|
|
|
132
|
|
|
18
|
|
|
|
|
73
|
|
|
18
|
|
|
|
|
3947
|
|
|
272
|
|
|
|
|
1036
|
|
|
272
|
|
|
|
|
435
|
|
|
272
|
|
|
|
|
381
|
|
|
272
|
|
|
|
|
796
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
415
|
|
|
272
|
|
|
|
|
482
|
|
|
272
|
|
|
|
|
698
|
|
|
0
|
|
|
|
|
0
|
|
|
272
|
|
|
|
|
633
|
|
|
272
|
|
|
|
|
486
|
|
|
272
|
|
|
|
|
901
|
|
|
272
|
|
|
|
|
704
|
|
|
272
|
|
|
|
|
417
|
|
|
272
|
|
|
|
|
698
|
|
|
272
|
|
|
|
|
1377
|
|
|
272
|
|
|
|
|
775
|
|
|
272
|
|
|
|
|
629
|
|
|
272
|
|
|
|
|
339
|
|
|
272
|
|
|
|
|
1233
|
|
|
272
|
|
|
|
|
381
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Don't fail if no help provided. |
33
|
272
|
100
|
|
|
|
848
|
return 1 if !defined $href; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# self->args |
36
|
17
|
50
|
|
|
|
89
|
if( exists $href->{args} ){ |
37
|
17
|
|
|
|
|
49
|
$self->args( { %{$href->{args}} } ); |
|
17
|
|
|
|
|
652
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# self->examples |
41
|
17
|
50
|
|
|
|
75
|
if( exists $href->{examples} ){ |
42
|
17
|
|
|
|
|
46
|
$self->examples( [ @{$href->{examples}} ] ); |
|
17
|
|
|
|
|
599
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
17
|
|
|
|
|
76
|
return 1; # success |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
18
|
50
|
|
18
|
|
35756
|
method has_help (Str $arg) { |
|
18
|
50
|
|
18
|
|
50
|
|
|
18
|
50
|
|
5
|
|
2987
|
|
|
18
|
50
|
|
|
|
154
|
|
|
18
|
50
|
|
|
|
51
|
|
|
18
|
|
|
|
|
2071
|
|
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
20
|
|
|
5
|
|
|
|
|
10
|
|
49
|
|
|
|
|
|
|
|
50
|
5
|
50
|
|
|
|
140
|
if( exists $self->args->{$arg} ){ |
51
|
5
|
|
|
|
|
15
|
return 1; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
0
|
return 0; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
18
|
0
|
|
18
|
|
34806
|
method get_usage (Str $arg) { |
|
18
|
0
|
|
18
|
|
44
|
|
|
18
|
0
|
|
0
|
|
2842
|
|
|
18
|
0
|
|
|
|
125
|
|
|
18
|
0
|
|
|
|
42
|
|
|
18
|
|
|
|
|
1594
|
|
|
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
|
|
34608
|
method get_help (Str $arg) { |
|
18
|
50
|
|
18
|
|
64
|
|
|
18
|
50
|
|
5
|
|
2940
|
|
|
18
|
50
|
|
|
|
125
|
|
|
18
|
50
|
|
|
|
49
|
|
|
18
|
|
|
|
|
2404
|
|
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
34
|
|
|
5
|
|
|
|
|
43
|
|
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
8
|
|
63
|
|
|
|
|
|
|
|
64
|
5
|
50
|
|
|
|
15
|
if ($self->has_help($arg)) { |
65
|
5
|
|
|
|
|
115
|
return $self->args->{$arg}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
0
|
return ""; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
18
|
50
|
|
18
|
|
18697
|
method has_examples { |
|
18
|
|
|
1
|
|
42
|
|
|
18
|
|
|
|
|
3359
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3
|
|
72
|
|
|
|
|
|
|
|
73
|
1
|
50
|
|
|
|
2
|
if( @{$self->examples} ){ |
|
1
|
|
|
|
|
27
|
|
74
|
1
|
|
|
|
|
5
|
return 1; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return 0; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |