line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ============================================================================ |
2
|
|
|
|
|
|
|
package MooseX::App::Plugin::Man::Command; |
3
|
|
|
|
|
|
|
# ============================================================================ |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1314
|
use 5.010; |
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
9
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
28
|
use namespace::autoclean; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
6
|
|
9
|
1
|
|
|
1
|
|
84
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
10
|
1
|
|
|
1
|
|
7467
|
use MooseX::App::Command; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
11
|
1
|
|
|
1
|
|
4272
|
use Pod::Perldoc; |
|
1
|
|
|
|
|
16397
|
|
|
1
|
|
|
|
|
311
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
command_short_description q(Full manpage); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'command' => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
isa => 'ArrayRef', |
18
|
|
|
|
|
|
|
predicate => 'has_command', |
19
|
|
|
|
|
|
|
documentation => q[Command], |
20
|
|
|
|
|
|
|
traits => ['MooseX::App::Meta::Role::Attribute::Option'], |
21
|
|
|
|
|
|
|
cmd_type => 'parameter', |
22
|
|
|
|
|
|
|
cmd_position => 1, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub man { |
26
|
0
|
|
|
0
|
0
|
|
my ($self,$app) = @_; |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
my $meta = $app->meta; |
29
|
0
|
|
|
|
|
|
my $class; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if ($self->has_command) { |
32
|
0
|
|
|
|
|
|
my $return = $meta->command_find($self->command); |
33
|
|
|
|
|
|
|
# Nothing found |
34
|
0
|
0
|
0
|
|
|
|
if (blessed $return |
35
|
|
|
|
|
|
|
&& $return->isa('MooseX::App::Message::Block')) { |
36
|
0
|
|
|
|
|
|
return MooseX::App::Message::Envelope->new( |
37
|
|
|
|
|
|
|
$return, |
38
|
|
|
|
|
|
|
$meta->command_usage_command($self->meta), |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
} |
41
|
0
|
|
|
|
|
|
$class = $meta->command_get($return); |
42
|
|
|
|
|
|
|
} else { |
43
|
0
|
|
|
|
|
|
$class = $meta->name; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
Class::Load::load_class($class); |
47
|
0
|
|
|
|
|
|
my $filename = MooseX::App::Utils::package_to_filename($class); |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
exec('perldoc',$filename); |
50
|
|
|
|
|
|
|
#return $MooseX::App::Null::NULL; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
54
|
|
|
|
|
|
|
1; |