blob: 1fea3ab5490e3bba98d5dd57a23c1f5abf079614 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package Reply::Plugin::DataPrinter;
use strict;
use warnings;
# ABSTRACT: format results using Data::Printer
use base 'Reply::Plugin';
use Data::Printer alias => 'p', colored => 1, return_value => 'dump';
=head1 SYNOPSIS
; .replyrc
[DataPrinter]
=head1 DESCRIPTION
This plugin uses L<Data::Printer> to format results.
=cut
sub mangle_result {
my ($self, @result) = @_;
return unless @result;
( @result == 1 ) && return p($result[0]);
return p(@result);
}
1;
|