line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ============================================================================ |
2
|
|
|
|
|
|
|
package MooseX::App::Plugin::Man; |
3
|
|
|
|
|
|
|
# ============================================================================ |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
982
|
use 5.010; |
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
24
|
use namespace::autoclean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
9
|
1
|
|
|
1
|
|
77
|
use Moose::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub plugin_metaroles { |
12
|
0
|
|
|
0
|
0
|
|
my ($self,$class) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
return { |
15
|
0
|
|
|
|
|
|
class => ['MooseX::App::Plugin::Man::Meta::Class'], |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
around 'initialize_command_class' => sub { |
20
|
|
|
|
|
|
|
my $orig = shift; |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $return = $self->$orig(@_); |
24
|
|
|
|
|
|
|
if (blessed $return |
25
|
|
|
|
|
|
|
&& $return->isa('MooseX::App::Plugin::Man::Command')) { |
26
|
|
|
|
|
|
|
return $return->man($self); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
return $return; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=encoding utf8 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
MooseX::App::Plugin::Man - Adds a command to display the full manual |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
In your base class: |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
package MyApp; |
46
|
|
|
|
|
|
|
use MooseX::App qw(Man); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
In your shell |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
bash$ myapp man somecommand |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 DESCRIPTION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This plugin adds a command to display the full manpage/perldoc of your |
55
|
|
|
|
|
|
|
application. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |