line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YA::CLI::Usage; |
2
|
|
|
|
|
|
|
our $VERSION = '0.004'; |
3
|
2
|
|
|
2
|
|
3081
|
use Moo; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
11
|
|
4
|
2
|
|
|
2
|
|
1677
|
use namespace::autoclean; |
|
2
|
|
|
|
|
28280
|
|
|
2
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Class that handles usage and man page generation for action handlers |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
204
|
use Carp qw(croak); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
98
|
|
9
|
2
|
|
|
2
|
|
12
|
use List::Util qw(first); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
104
|
|
10
|
2
|
|
|
2
|
|
11
|
use Pod::Find qw(pod_where); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
109
|
|
11
|
2
|
|
|
2
|
|
1293
|
use Pod::Usage qw(pod2usage); |
|
2
|
|
|
|
|
103467
|
|
|
2
|
|
|
|
|
590
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has verbose => ( |
14
|
|
|
|
|
|
|
is => 'ro', |
15
|
|
|
|
|
|
|
default => 1, |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has rc => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
default => 0, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has message => ( |
24
|
|
|
|
|
|
|
is => 'ro', |
25
|
|
|
|
|
|
|
predicate => 'has_message', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has pod_file => ( |
29
|
|
|
|
|
|
|
is => 'ro', |
30
|
|
|
|
|
|
|
predicate => 'has_pod_file' |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub run { |
34
|
11
|
|
|
11
|
1
|
1417
|
my $self = shift; |
35
|
|
|
|
|
|
|
|
36
|
11
|
|
|
|
|
29
|
my $pod_where = $self->_pod_where; |
37
|
|
|
|
|
|
|
|
38
|
11
|
100
|
|
|
|
142
|
$self->_pod2usage( |
|
|
100
|
|
|
|
|
|
39
|
|
|
|
|
|
|
$self->has_message ? (-message => $self->message) : (), |
40
|
|
|
|
|
|
|
-verbose => $self->verbose, |
41
|
|
|
|
|
|
|
-exitval => $self->rc, |
42
|
|
|
|
|
|
|
$pod_where ? ('-input' => $pod_where) : (), |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub _pod_where { |
47
|
0
|
|
|
0
|
|
|
my $self = shift; |
48
|
0
|
0
|
|
|
|
|
return unless $self->has_pod_file; |
49
|
0
|
|
|
|
|
|
return pod_where({ -inc => 1 }, $self->pod_file); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _pod2usage { |
53
|
0
|
|
|
0
|
|
|
my $self = shift; |
54
|
0
|
|
|
|
|
|
pod2usage(@_); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |