line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
14
|
|
|
14
|
|
115421
|
|
|
14
|
|
|
|
|
32
|
|
|
14
|
|
|
|
|
94
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use parent 'Catmandu::Cmd'; |
7
|
14
|
|
|
14
|
|
91
|
use Catmandu; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
84
|
|
8
|
14
|
|
|
14
|
|
1011
|
use Catmandu::Util qw(pod_section); |
|
14
|
|
|
|
|
29
|
|
|
14
|
|
|
|
|
70
|
|
9
|
14
|
|
|
14
|
|
2884
|
use namespace::clean; |
|
14
|
|
|
|
|
43
|
|
|
14
|
|
|
|
|
785
|
|
10
|
14
|
|
|
14
|
|
93
|
|
|
14
|
|
|
|
|
23
|
|
|
14
|
|
|
|
|
71
|
|
11
|
|
|
|
|
|
|
( |
12
|
|
|
|
|
|
|
["all", "show all module on this server"], |
13
|
|
|
|
|
|
|
["exporters", "show all Catmandu exporters"], |
14
|
7
|
|
|
7
|
1
|
158
|
["importers", "show all Catmandu importers"], |
15
|
|
|
|
|
|
|
["fixes", "show all Catmandu fixes"], |
16
|
|
|
|
|
|
|
["stores", "show all Catmandu stores"], |
17
|
|
|
|
|
|
|
["validators", "show all Catmandu validators"], |
18
|
|
|
|
|
|
|
["namespace=s", "search by namespace"], |
19
|
|
|
|
|
|
|
["max_depth=i", "maximum depth to search for modules"], |
20
|
|
|
|
|
|
|
[ |
21
|
|
|
|
|
|
|
"inc=s@", |
22
|
|
|
|
|
|
|
'override included directories (defaults to @INC)', |
23
|
|
|
|
|
|
|
{default => [@INC]} |
24
|
|
|
|
|
|
|
], |
25
|
|
|
|
|
|
|
["brief", "omit short module description"], |
26
|
|
|
|
|
|
|
["verbose|v", ""], |
27
|
|
|
|
|
|
|
["fix=s@", ""], |
28
|
|
|
|
|
|
|
["var=s%", ""], |
29
|
|
|
|
|
|
|
["preprocess|pp", ""], |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my ($self, $opts, $args) = @_; |
34
|
|
|
|
|
|
|
my $verbose = $opts->verbose; |
35
|
|
|
|
|
|
|
|
36
|
7
|
|
|
7
|
1
|
22
|
if (defined $opts->{namespace}) { |
37
|
7
|
|
|
|
|
28
|
} |
38
|
|
|
|
|
|
|
elsif ($opts->{all}) { |
39
|
7
|
50
|
|
|
|
68
|
delete $opts->{all}; |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
elsif ($opts->{exporters}) { |
42
|
0
|
|
|
|
|
0
|
delete $opts->{exporters}; |
43
|
|
|
|
|
|
|
$opts->{namespace} = 'Catmandu::Exporter'; |
44
|
|
|
|
|
|
|
} |
45
|
1
|
|
|
|
|
3
|
elsif ($opts->{importers}) { |
46
|
1
|
|
|
|
|
3
|
delete $opts->{importers}; |
47
|
|
|
|
|
|
|
$opts->{namespace} = 'Catmandu::Importer'; |
48
|
|
|
|
|
|
|
} |
49
|
1
|
|
|
|
|
2
|
elsif ($opts->{fixes}) { |
50
|
1
|
|
|
|
|
3
|
delete $opts->{fixes}; |
51
|
|
|
|
|
|
|
$opts->{namespace} = 'Catmandu::Fix'; |
52
|
|
|
|
|
|
|
} |
53
|
2
|
|
|
|
|
6
|
elsif ($opts->{stores}) { |
54
|
2
|
|
|
|
|
5
|
delete $opts->{stores}; |
55
|
|
|
|
|
|
|
$opts->{namespace} = 'Catmandu::Store'; |
56
|
|
|
|
|
|
|
} |
57
|
1
|
|
|
|
|
4
|
elsif ($opts->{validators}) { |
58
|
1
|
|
|
|
|
3
|
delete $opts->{stores}; |
59
|
|
|
|
|
|
|
$opts->{namespace} = 'Catmandu::Validator'; |
60
|
|
|
|
|
|
|
} |
61
|
1
|
|
|
|
|
2
|
else { |
62
|
1
|
|
|
|
|
2
|
$opts->{namespace} = [qw(Catmandu)]; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
4
|
my ($from_args, $from_opts, $into_args, $into_opts) |
66
|
|
|
|
|
|
|
= $self->_parse_options($args); |
67
|
|
|
|
|
|
|
$from_opts->{about} = !$opts->{brief}; |
68
|
7
|
|
|
|
|
62
|
|
69
|
|
|
|
|
|
|
for my $key (qw(inc namespace max_depth)) { |
70
|
7
|
|
|
|
|
27
|
$from_opts->{$key} = $opts->$key if defined $opts->$key; |
71
|
|
|
|
|
|
|
} |
72
|
7
|
|
|
|
|
18
|
|
73
|
21
|
100
|
|
|
|
120
|
my $from = Catmandu->importer('Modules', $from_opts); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
if (@$into_args || %$into_opts) { |
76
|
7
|
|
|
|
|
82
|
if ($opts->fix) { |
77
|
|
|
|
|
|
|
$from = $self->_build_fixer($opts)->fix($from); |
78
|
7
|
100
|
66
|
|
|
102
|
} |
79
|
1
|
50
|
|
|
|
5
|
|
80
|
0
|
|
|
|
|
0
|
my $into = Catmandu->exporter($into_args->[0], $into_opts); |
81
|
|
|
|
|
|
|
$into->add_many($from); |
82
|
|
|
|
|
|
|
$into->commit; |
83
|
1
|
|
|
|
|
10
|
} |
84
|
1
|
|
|
|
|
5
|
else { |
85
|
1
|
|
|
|
|
29
|
my $cols = [qw(name version)]; |
86
|
|
|
|
|
|
|
push @$cols, 'about' unless $opts->brief; |
87
|
|
|
|
|
|
|
push @$cols, 'file' if $opts->verbose; |
88
|
6
|
|
|
|
|
16
|
$from->format(cols => $cols); |
89
|
6
|
50
|
|
|
|
36
|
} |
90
|
6
|
50
|
|
|
|
42
|
} |
91
|
6
|
|
|
|
|
42
|
|
92
|
|
|
|
|
|
|
1; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=pod |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 NAME |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Catmandu::Cmd::info - list installed Catmandu modules |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 DESCRIPTION |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
This L<Catmandu::Cmd> uses L<Catmandu::Importer::Modules> to list all modules. |
104
|
|
|
|
|
|
|
By default modules are listed in tabular form, like L<Catmandu::Exporter::Table>. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 EXAMPLES |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
catmandu info --exporters |
109
|
|
|
|
|
|
|
catmandu info --importers |
110
|
|
|
|
|
|
|
catmandu info --fixes |
111
|
|
|
|
|
|
|
catmandu info --stores |
112
|
|
|
|
|
|
|
catmandu info --validators |
113
|
|
|
|
|
|
|
catmandu info --namespace=Catmandu |
114
|
|
|
|
|
|
|
catmandu info --all |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
# export list of exporter modules to JSON |
117
|
|
|
|
|
|
|
catmandu info --exporters to JSON |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |