From: Nicolas Boisselier Date: Thu, 20 Apr 2023 00:58:58 +0000 (+0200) Subject: VERBOSE=0 when option --format X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=9b4a549f0eb3bfc68f5965cf21437eff85cb608b;p=nb.git VERBOSE=0 when option --format --- diff --git a/bin/csv2human b/bin/csv2human index 5eb27e87..ab93d964 100755 --- a/bin/csv2human +++ b/bin/csv2human @@ -42,6 +42,10 @@ $main::_DATA_ = undef; use Encode; binmode( STDOUT, "utf8:" ); + +# +# Calculate lengths +# my @len = (); my @lines = (); @@ -61,6 +65,9 @@ while (<>) { exit unless @lines; +# +# Build format string +# my $tot = @lines - ($Opt{header} ? 1 : 0); my $t = -1; @@ -72,8 +79,12 @@ if ($Opt{format}) { my $sep = " ".$Opt{sep}." "; $format = join($sep,map {$t+=$_+length($sep); "\%-".$_."s"} @len).chr(10); $sep_line = ""; + $VERBOSE = 0; } +# +# Print +# print $sep_line; my $i = 0; my $count;