| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# -*- coding: utf-8 -*- |
|
2
|
|
|
|
|
|
|
# Copyright (C) 2011-2012, 2014-2015 Rocky Bernstein <rocky@cpan.org> |
|
3
|
12
|
|
|
12
|
|
91
|
use warnings; no warnings 'redefine'; no warnings 'once'; |
|
|
12
|
|
|
12
|
|
39
|
|
|
|
12
|
|
|
12
|
|
606
|
|
|
|
12
|
|
|
|
|
84
|
|
|
|
12
|
|
|
|
|
34
|
|
|
|
12
|
|
|
|
|
437
|
|
|
|
12
|
|
|
|
|
84
|
|
|
|
12
|
|
|
|
|
37
|
|
|
|
12
|
|
|
|
|
367
|
|
|
4
|
12
|
|
|
12
|
|
71
|
use rlib '../../../../../..'; |
|
|
12
|
|
|
|
|
33
|
|
|
|
12
|
|
|
|
|
78
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Devel::Trepan::CmdProcessor::Command::Show::Display::Eval; |
|
7
|
12
|
|
|
12
|
|
5614
|
use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd; |
|
|
12
|
|
|
|
|
39
|
|
|
|
12
|
|
|
|
|
373
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
12
|
|
|
12
|
|
79
|
use strict; |
|
|
12
|
|
|
|
|
36
|
|
|
|
12
|
|
|
|
|
345
|
|
|
10
|
12
|
|
|
12
|
|
68
|
use vars qw(@ISA @SUBCMD_VARS); |
|
|
12
|
|
|
|
|
34
|
|
|
|
12
|
|
|
|
|
977
|
|
|
11
|
|
|
|
|
|
|
@ISA = qw(Devel::Trepan::CmdProcessor::Command::Subsubcmd); |
|
12
|
|
|
|
|
|
|
# Values inherited from parent |
|
13
|
12
|
|
|
12
|
|
110
|
use vars @Devel::Trepan::CmdProcessor::Command::Subsubcmd::SUBCMD_VARS; |
|
|
12
|
|
|
|
|
30
|
|
|
|
12
|
|
|
|
|
5640
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
## FIXME: do automatically. |
|
16
|
|
|
|
|
|
|
our $CMD = 'show display eval'; |
|
17
|
|
|
|
|
|
|
our $HELP = <<"EOH"; |
|
18
|
|
|
|
|
|
|
B<show display eval> [B<long>] |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Shows which of Data::Printer ('ddp'), |
|
21
|
|
|
|
|
|
|
Data::Dumper ('dumper'), Data::Dumper::Concise, |
|
22
|
|
|
|
|
|
|
Data::Dumper::Perltidy ('tidy') is used to format evaluation results. |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
For Data::Dumper, if B<long> is given the configuration will be show. |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 See also: |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
L<C<set display eval>|Devel::Trepan::CmdProcessor::Command::Set::Display::Eval>, |
|
29
|
|
|
|
|
|
|
L<C<eval>|Devel::Trepan::CmdProcessor::Command::Eval>, |
|
30
|
|
|
|
|
|
|
L<C<set auto eval>|Devel::Trepan::CmdProcessor::Command::Set::Auto::Eval>, |
|
31
|
|
|
|
|
|
|
L<C<set auto eval>|Devel::Trepan::CmdProcessor::Command::Set::Auto::Eval>, |
|
32
|
|
|
|
|
|
|
L<Data::Dumper::Perltidy>, and |
|
33
|
|
|
|
|
|
|
L<Data::Printer>. |
|
34
|
|
|
|
|
|
|
EOH |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
our $SHORT_HELP = 'Show how the evaluation results are displayed'; |
|
37
|
|
|
|
|
|
|
our $MIN_ABBREV = length('ev'); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub run($$) |
|
40
|
|
|
|
|
|
|
{ |
|
41
|
0
|
|
|
0
|
|
|
my ($self, $args) = @_; |
|
42
|
0
|
|
|
|
|
|
my $proc = $self->{proc}; |
|
43
|
0
|
|
|
|
|
|
my $key = $self->{subcmd_setting_key}; |
|
44
|
0
|
|
|
|
|
|
my $val = $proc->{settings}{$key}; |
|
45
|
0
|
|
|
|
|
|
my $msg = sprintf "Eval result display style is %s.", $val; |
|
46
|
0
|
|
|
|
|
|
$proc->msg($msg); |
|
47
|
0
|
0
|
|
|
|
|
if ($val eq 'tidy') { |
|
|
|
0
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
$proc->msg("Perlidy options: " . $Data::Dumper::Perltidy::ARGV); |
|
49
|
|
|
|
|
|
|
} elsif ($val eq 'ddp') { |
|
50
|
0
|
|
|
|
|
|
my @args = @{$args}; |
|
|
0
|
|
|
|
|
|
|
|
51
|
0
|
0
|
0
|
|
|
|
if (scalar @args > 3 && $args[3] eq 'long') { |
|
52
|
0
|
|
|
|
|
|
$proc->msg("Data::Printer options:"); |
|
53
|
0
|
|
|
|
|
|
my $opts = Data::Printer::p($Data::Printer::properties); |
|
54
|
0
|
|
|
|
|
|
$proc->msg($opts); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
unless (caller) { |
|
60
|
|
|
|
|
|
|
# Demo it. |
|
61
|
|
|
|
|
|
|
# FIXME: DRY the below code |
|
62
|
|
|
|
|
|
|
require Devel::Trepan::CmdProcessor; |
|
63
|
|
|
|
|
|
|
my $cmdproc = Devel::Trepan::CmdProcessor->new(); |
|
64
|
|
|
|
|
|
|
my $subcmd = Devel::Trepan::CmdProcessor::Command::Show->new($cmdproc, |
|
65
|
|
|
|
|
|
|
'show'); |
|
66
|
|
|
|
|
|
|
my $dispcmd = Devel::Trepan::CmdProcessor::Command::Show::Display->new($subcmd, 'display'); |
|
67
|
|
|
|
|
|
|
my $cmd = Devel::Trepan::CmdProcessor::Command::Show::Display::Eval->new($dispcmd, 'eval'); |
|
68
|
|
|
|
|
|
|
# Add common routine |
|
69
|
|
|
|
|
|
|
foreach my $field (qw(min_abbrev name)) { |
|
70
|
|
|
|
|
|
|
printf "Field %s is: %s\n", $field, $cmd->{$field}; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
$cmd->run(['show', 'display', 'eval']); |
|
73
|
|
|
|
|
|
|
$cmd->run(['show', 'display', 'eval', 'long']); |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |