line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public License |
2
|
|
|
|
|
|
|
# or the Artistic License (the same terms as Perl itself) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) Paul Evans, 2022 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Devel::MAT::Tool::Tools 0.49; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
2270
|
use v5.14; |
|
4
|
|
|
|
|
19
|
|
9
|
4
|
|
|
4
|
|
19
|
use warnings; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
100
|
|
10
|
4
|
|
|
4
|
|
18
|
use base qw( Devel::MAT::Tool ); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
333
|
|
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
4
|
|
23
|
use constant CMD => "tools"; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
178
|
|
13
|
4
|
|
|
4
|
|
20
|
use constant CMD_DESC => "List the available tools"; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
886
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub run |
16
|
|
|
|
|
|
|
{ |
17
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my @table; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
foreach my $tool ( sort Devel::MAT->available_tools ) { |
22
|
0
|
|
|
|
|
|
my $tool_class = "Devel::MAT::Tool::$tool"; |
23
|
0
|
0
|
0
|
|
|
|
next unless $tool_class->can( "FOR_UI" ) and $tool_class->FOR_UI; |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
my $desc = $tool_class->can( "TOOL_DESC" ) ? $tool_class->TOOL_DESC : undef; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my $loaded = $self->pmat->has_tool( $tool ); |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
0
|
|
|
|
push @table, [ |
30
|
|
|
|
|
|
|
String::Tagged->from_sprintf( "%s %s", |
31
|
|
|
|
|
|
|
( $loaded ? Devel::MAT::Cmd->format_note( "*", 1 ) : " " ), |
32
|
|
|
|
|
|
|
Devel::MAT::Cmd->format_note( $tool, 0 ), |
33
|
|
|
|
|
|
|
), |
34
|
|
|
|
|
|
|
$desc // "" |
35
|
|
|
|
|
|
|
]; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
Devel::MAT::Cmd->print_table( \@table, sep => " - " ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
package # hide |
42
|
|
|
|
|
|
|
Devel::MAT::Tool::Tools::_tool; |
43
|
|
|
|
|
|
|
|
44
|
4
|
|
|
4
|
|
26
|
use base qw( Devel::MAT::Tool ); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
362
|
|
45
|
|
|
|
|
|
|
|
46
|
4
|
|
|
4
|
|
22
|
use constant CMD => "tool"; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
209
|
|
47
|
4
|
|
|
4
|
|
26
|
use constant CMD_DESC => "Load an extension tool"; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
217
|
|
48
|
|
|
|
|
|
|
|
49
|
4
|
|
|
|
|
408
|
use constant CMD_ARGS => ( |
50
|
|
|
|
|
|
|
{ name => "tool", help => "the name of the tool to load" }, |
51
|
4
|
|
|
4
|
|
23
|
); |
|
4
|
|
|
|
|
7
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub run |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
0
|
|
|
my $self = shift; |
56
|
0
|
|
|
|
|
|
my ( $toolname ) = @_; |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
my $tool = $self->pmat->load_tool( $toolname, progress => $self->{progress} ); |
59
|
0
|
|
|
|
|
|
$self->report_progress(); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
0x55AA; |