line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Beam::Runner::Command::help; |
2
|
|
|
|
|
|
|
our $VERSION = '0.016'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Get help for the given service(s) |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#pod =head1 SYNOPSIS |
6
|
|
|
|
|
|
|
#pod |
7
|
|
|
|
|
|
|
#pod beam help |
8
|
|
|
|
|
|
|
#pod |
9
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
10
|
|
|
|
|
|
|
#pod |
11
|
|
|
|
|
|
|
#pod Show the documentation for the given service from the given container. |
12
|
|
|
|
|
|
|
#pod |
13
|
|
|
|
|
|
|
#pod =head1 SEE ALSO |
14
|
|
|
|
|
|
|
#pod |
15
|
|
|
|
|
|
|
#pod L, L, L |
16
|
|
|
|
|
|
|
#pod |
17
|
|
|
|
|
|
|
#pod =cut |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
105669
|
use strict; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
30
|
|
20
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
21
|
1
|
|
|
1
|
|
424
|
use Beam::Runner::Util qw( find_container_path ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
58
|
|
22
|
1
|
|
|
1
|
|
507
|
use Pod::Usage qw( pod2usage ); |
|
1
|
|
|
|
|
47044
|
|
|
1
|
|
|
|
|
105
|
|
23
|
1
|
|
|
1
|
|
11
|
use Pod::Find qw( pod_where ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
54
|
|
24
|
1
|
|
|
1
|
|
721
|
use Beam::Wire; |
|
1
|
|
|
|
|
503115
|
|
|
1
|
|
|
|
|
266
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub run { |
27
|
6
|
|
|
6
|
0
|
30519
|
my ( $class, $container, $service_name ) = @_; |
28
|
|
|
|
|
|
|
|
29
|
6
|
100
|
100
|
|
|
44
|
if ( !$container || !$service_name ) { |
30
|
2
|
|
|
|
|
736
|
return pod2usage( |
31
|
|
|
|
|
|
|
-message => 'ERROR: and are required', |
32
|
|
|
|
|
|
|
-input => pod_where( { -inc => 1 }, __PACKAGE__ ), |
33
|
|
|
|
|
|
|
-verbose => 0, |
34
|
|
|
|
|
|
|
-exitval => 1, |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
4
|
|
|
|
|
21
|
my $path = find_container_path( $container ); |
39
|
3
|
|
|
|
|
113
|
my $wire = Beam::Wire->new( |
40
|
|
|
|
|
|
|
file => $path, |
41
|
|
|
|
|
|
|
); |
42
|
3
|
|
|
|
|
76779
|
my $service_conf = $wire->get_config( $service_name ); |
43
|
3
|
100
|
|
|
|
101
|
die sprintf qq{Could not find service "%s" in container "%s"\n}, |
44
|
|
|
|
|
|
|
$service_name, $path |
45
|
|
|
|
|
|
|
unless $service_conf; |
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
|
|
7
|
my %service_conf = %{ $wire->normalize_config( $service_conf ) }; |
|
2
|
|
|
|
|
12
|
|
48
|
2
|
|
|
|
|
155
|
%service_conf = $wire->merge_config( %service_conf ); |
49
|
2
|
|
|
|
|
1505
|
my $pod_path = pod_where( { -inc => 1 }, $service_conf{class} ); |
50
|
2
|
100
|
|
|
|
18
|
if ( !$pod_path ) { |
51
|
1
|
|
|
|
|
345
|
die "Could not find documentation for class '$service_conf{class}'\n"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
pod2usage( |
54
|
1
|
|
|
|
|
11
|
-input => $pod_path, |
55
|
|
|
|
|
|
|
-verbose => 2, |
56
|
|
|
|
|
|
|
-exitval => 0, |
57
|
|
|
|
|
|
|
); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |