From 2c4827ca9f095e6f62fb059c87f9d4515cfa6c2b Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 20 Dec 2020 20:12:20 +0100 Subject: [PATCH] btrbk: support custom table format --- btrbk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/btrbk b/btrbk index 0e26904..55f7d1b 100755 --- a/btrbk +++ b/btrbk @@ -5056,6 +5056,14 @@ sub print_formatted(@) my $fh = $args{outfile} // *STDOUT; my $table_spacing = 2; + if($format =~ s/^col:\s*(h:)?\s*//) { + $args{no_header} = 1 if($1); + $key_defs = []; $ralign = {}; + foreach (split(/\s*,\s*/, $format)) { + $ralign->{$_} = 1 if s/:R(ALIGN)?$//i; + push @$key_defs, lc($_); + } + } unless($key_defs) { WARN "Unsupported output format \"$format\", defaulting to \"$default_format\" format."; $key_defs = $table_format->{$default_format} || die;