]> git.nbdom.net Git - nb.git/commitdiff
VERBOSE=0 when option --format
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 20 Apr 2023 00:58:58 +0000 (02:58 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 20 Apr 2023 00:58:58 +0000 (02:58 +0200)
bin/csv2human

index 5eb27e879d66466ab442b1d68555cf95e1cf7e34..ab93d964cdb226014e3ac741cf928a7ed8ee24cb 100755 (executable)
@@ -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;