line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
14
|
|
|
14
|
|
110993
|
|
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
75
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use parent 'Catmandu::Cmd'; |
7
|
14
|
|
|
14
|
|
99
|
use Catmandu; |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
69
|
|
8
|
14
|
|
|
14
|
|
956
|
use Catmandu::Util qw(pod_section); |
|
14
|
|
|
|
|
30
|
|
|
14
|
|
|
|
|
62
|
|
9
|
14
|
|
|
14
|
|
2667
|
use namespace::clean; |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
676
|
|
10
|
14
|
|
|
14
|
|
87
|
|
|
14
|
|
|
|
|
25
|
|
|
14
|
|
|
|
|
74
|
|
11
|
|
|
|
|
|
|
( |
12
|
|
|
|
|
|
|
["all", "show all module on this server"], |
13
|
|
|
|
|
|
|
["exporters", "show all Catmandu exporters"], |
14
|
7
|
|
|
7
|
1
|
141
|
["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
|
15
|
if (defined $opts->{namespace}) { |
37
|
7
|
|
|
|
|
23
|
} |
38
|
|
|
|
|
|
|
elsif ($opts->{all}) { |
39
|
7
|
50
|
|
|
|
64
|
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
|
|
|
|
|
2
|
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
|
|
|
|
|
4
|
elsif ($opts->{stores}) { |
54
|
2
|
|
|
|
|
6
|
delete $opts->{stores}; |
55
|
|
|
|
|
|
|
$opts->{namespace} = 'Catmandu::Store'; |
56
|
|
|
|
|
|
|
} |
57
|
1
|
|
|
|
|
3
|
elsif ($opts->{validators}) { |
58
|
1
|
|
|
|
|
3
|
delete $opts->{stores}; |
59
|
|
|
|
|
|
|
$opts->{namespace} = 'Catmandu::Validator'; |
60
|
|
|
|
|
|
|
} |
61
|
1
|
|
|
|
|
3
|
else { |
62
|
1
|
|
|
|
|
2
|
$opts->{namespace} = [qw(Catmandu)]; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
3
|
my ($from_args, $from_opts, $into_args, $into_opts) |
66
|
|
|
|
|
|
|
= $self->_parse_options($args); |
67
|
|
|
|
|
|
|
$from_opts->{about} = !$opts->{brief}; |
68
|
7
|
|
|
|
|
31
|
|
69
|
|
|
|
|
|
|
for my $key (qw(inc namespace max_depth)) { |
70
|
7
|
|
|
|
|
20
|
$from_opts->{$key} = $opts->$key if defined $opts->$key; |
71
|
|
|
|
|
|
|
} |
72
|
7
|
|
|
|
|
18
|
|
73
|
21
|
100
|
|
|
|
126
|
my $from = Catmandu->importer('Modules', $from_opts); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
if (@$into_args || %$into_opts) { |
76
|
7
|
|
|
|
|
54
|
if ($opts->fix) { |
77
|
|
|
|
|
|
|
$from = $self->_build_fixer($opts)->fix($from); |
78
|
7
|
100
|
66
|
|
|
80
|
} |
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
|
|
|
|
|
9
|
} |
84
|
1
|
|
|
|
|
5
|
else { |
85
|
1
|
|
|
|
|
27
|
my $cols = [qw(name version)]; |
86
|
|
|
|
|
|
|
push @$cols, 'about' unless $opts->brief; |
87
|
|
|
|
|
|
|
push @$cols, 'file' if $opts->verbose; |
88
|
6
|
|
|
|
|
18
|
$from->format(cols => $cols); |
89
|
6
|
50
|
|
|
|
20
|
} |
90
|
6
|
50
|
|
|
|
41
|
} |
91
|
6
|
|
|
|
|
47
|
|
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 |