App-cpanmw
view release on metacpan or search on metacpan
script/cpanmw view on Meta::CPAN
}
## GLOBAL hook
{
*App::cpanminus::script::_diag = sub {
my $caller = ( caller(1) )[3];
goto &{ $org_m->{_diag} }
unless $caller =~ s/^App::cpanminus::script:://;
### $caller
my @arg = @_;
if ( $caller eq 'diag_ok' ) {
$arg[1] = colored( $arg[1], 'bold green' );
}
elsif ( $caller eq 'diag_fail' ) {
$arg[1] = colored( $arg[1], 'bold red' );
}
elsif ( $caller eq 'diag_progress' ) {
$arg[1]
=~ s/^(Fetching|Configuring|Building(?: and testing)?)/colored($1,'cyan')/e;
}
elsif ( $arg[1] =~ /^-->/ ) {
$arg[1]
=~ s/(?<=--> Working on )(\S+)/colored( $1, 'bold yellow' )/e;
}
elsif ( $arg[1] =~ /^==>/ ) {
$arg[1] =~ s/(Found dependencies)/colored($1,'bold magenta')/e;
}
elsif ( $arg[1] =~ s/^(Successfully \S+)(\s+\S+)/colored($1,'bold green') . colored($2, 'bold yellow')/e )
{
}
elsif ( $_[0]->{verbose} ) {
$arg[1] = colored( $arg[1], 'cyan' );
}
@_ = @arg;
goto &{ $org_m->{_diag} };
};
*App::cpanminus::script::chat = sub {
( run in 2.022 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )