From: Dietmar Maurer Date: Fri, 27 Jul 2018 13:22:30 +0000 (+0200) Subject: print_api_result_plain: new helper X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=6bc094934b8067558d66c76670f0d1efdf51516c;hp=2ec79c0f952a49597dd0974ebfc24aea02ce63ae print_api_result_plain: new helper Usefull to print result without borders an headers. Signed-off-by: Dietmar Maurer --- diff --git a/src/PVE/CLIFormatter.pm b/src/PVE/CLIFormatter.pm index d964b51..2a2ff30 100644 --- a/src/PVE/CLIFormatter.pm +++ b/src/PVE/CLIFormatter.pm @@ -436,4 +436,16 @@ sub print_api_result { } } +sub print_api_result_plain { + my ($data, $result_schema, $props_to_print, $options) = @_; + + # avoid borders and header, ignore terminal width + $options = $options ? { %$options } : {}; # copy + + $options->{noheader} //= 1; + $options->{noborder} //= 1; + + print_api_result($data, $result_schema, $props_to_print, $options, {}); +} + 1;