btrbk: add single_column output format

pull/409/head
Axel Burri 2021-04-16 15:29:23 +02:00
parent c06d94543c
commit e82836be47
1 changed files with 9 additions and 1 deletions

10
btrbk
View File

@ -5112,7 +5112,15 @@ sub print_formatted(@)
# strips leading "-" from @keys
%hide_column = map { $_ => 1 } grep { s/^-// } @keys;
if($format eq "raw")
if($format eq "single_column")
{
# single-column: newline separated values, no headers
my $key = $keys[0];
foreach (grep defined, map $_->{$key}, @$data) {
print $fh $_ . "\n" if($_ ne "");
}
}
elsif($format eq "raw")
{
# output: key0="value0" key1="value1" ...
foreach my $row (@$data) {