[pve-devel] [pve-common 1/3] PVE::CLIFormatter::print_api_result - remove parameter $format

Dietmar Maurer dietmar at proxmox.com
Tue Jul 10 13:43:03 CEST 2018


Instead, we pass it within $options.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 src/PVE/CLIFormatter.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/PVE/CLIFormatter.pm b/src/PVE/CLIFormatter.pm
index 653a99f..043ce49 100644
--- a/src/PVE/CLIFormatter.pm
+++ b/src/PVE/CLIFormatter.pm
@@ -364,7 +364,7 @@ sub print_api_list {
 }
 
 sub print_api_result {
-    my ($format, $data, $result_schema, $props_to_print, $options) = @_;
+    my ($data, $result_schema, $props_to_print, $options) = @_;
 
     return if $options->{quiet};
 
@@ -374,6 +374,8 @@ sub print_api_result {
 	$options = { %$options }; # copy
     }
 
+    my $format = $options->{format} // 'text';
+
     return if $result_schema->{type} eq 'null';
 
     if ($format eq 'json') {
-- 
2.11.0




More information about the pve-devel mailing list