App-pscan
view release on metacpan or search on metacpan
lib/App/pscan/Utils.pm view on Meta::CPAN
for my $arg (@lines) {
my $title = shift @$arg;
my $padding = int($column_w) - length($title);
if ( $ENV{WRAP}
&& ( $column_w + 3 + length( join( " ", @$arg ) ) )
> $screen_width )
{
# wrap description
my $string
= color('bold')
. $title
. color('reset')
. " " x $padding . " - "
. join( " ", @$arg ) . "\n";
$string =~ s/\n//g;
my $cnt = 0;
my $firstline = 1;
my $tab = 4;
lib/App/pscan/Utils.pm view on Meta::CPAN
{
print "\n" . " " x ( $column_w + 3 + $tab );
$cnt = 0;
$wrapped = 1;
}
}
print "\n";
print "\n" if $wrapped;
}
else {
print color 'bold';
print $title;
print color 'reset';
print " " x $padding;
print " - ";
$$arg[0] = ' ' unless $$arg[0];
print join " ", @$arg;
print "\n";
}
}
lib/App/pscan/Utils.pm view on Meta::CPAN
sub info {
my @msg = @_;
print STDERR color 'green';
print STDERR join( "\n", @msg ), "\n";
print STDERR color 'reset';
}
sub notice {
my @msg = @_;
print STDERR color 'bold yellow';
print STDERR join( "\n", @msg ), "\n";
print STDERR color 'reset';
}
sub dialog_yes_default {
my $msg = shift;
local $|;
print STDERR $msg;
print STDERR ' (Y/n) ';
( run in 1.307 second using v1.01-cache-2.11-cpan-d8267643d1d )