From 713fe50372bf75a9351031deb4c1459e88c5663a Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 14 Feb 2021 15:30:15 +0100 Subject: [PATCH] btrbk: add empty_cell_char argument to print_formatted --- btrbk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/btrbk b/btrbk index 12f9935..38c7696 100755 --- a/btrbk +++ b/btrbk @@ -5059,6 +5059,7 @@ sub print_formatted(@) my $ralign = $table_format->{RALIGN} // {}; my $fh = $args{outfile} // *STDOUT; my $table_spacing = 2; + my $empty_cell_char = $args{empty_cell_char} // "-"; if($format =~ s/^col:\s*(h:)?\s*//) { $args{no_header} = 1 if($1); @@ -5120,8 +5121,7 @@ sub print_formatted(@) $val = join(',', @{$val}); } $print_row{$key} = 1 if(defined($val)); - $val //= "-"; - $val = "-" if($val eq ""); + $val = $empty_cell_char if(!defined($val) || ($val eq "")); $row->{$key} = $val; # write back the sanitized value $maxlen{$key} = length($val) if($maxlen{$key} < length($val)); }