| 1 | # ============================================================================ | ||||||||||||||||||||||||||||
| 2 | package MooseX::App::Plugin::Man::Command; | ||||||||||||||||||||||||||||
| 3 | # ============================================================================ | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use 5.010; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use MooseX::App::Command; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Pod::Perldoc; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | command_short_description q(Full manpage); | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | 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 | 0 | ▶ | sub man { | ||||||||||||||||||||||||||
|
Subroutine
man: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 26 | 0 | my ($self,$app) = @_; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | my $meta = $app->meta; | |||||||||||||||||||||||||||
| 29 | 0 | my $class; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | ▶ | if ($self->has_command) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | 0 | my $return = $meta->command_find($self->command); | |||||||||||||||||||||||||||
| 33 | # Nothing found | ||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if (blessed $return | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($return) and $return->isa("MooseX::App::Message::Block")
MC/DC0%0/2
builtin::blessed($return) and $return->isa("MooseX::App::Message::Block")
builtin::blessed($return)
$return->isa("MooseX::App::Message::Block")
Truth table0%0/3
A and B
A= builtin::blessed($return)B= $return->isa("MooseX::App::Message::Block")
| |||||||||||||||||||||||||||||
| 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 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 54 | 1 | 1; | |||||||||||||||||||||||||||