From: Dietmar Maurer Date: Fri, 22 Jun 2018 05:14:04 +0000 (+0200) Subject: PVE::CLIHandler::print_api_list - reorder arguments X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=8587474c3619a41c3bf73c54d5979fe055188314;hp=eb04f1e26c7353882e67e82cedeadde9b4254367 PVE::CLIHandler::print_api_list - reorder arguments Move optional argument to the end. --- diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index b4c95ef..a9ebc47 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -493,7 +493,7 @@ sub print_text_table { # prints the result of an API GET call returning an array # and to have the results key of the API call defined. sub print_api_list { - my ($props_to_print, $data, $returninfo) = @_; + my ($data, $returninfo, $props_to_print) = @_; die "can only print array result" if $returninfo->{type} ne 'array'; @@ -539,7 +539,7 @@ sub print_api_result { return if !scalar(@$data); my $item_type = $result_schema->{items}->{type}; if ($item_type eq 'object') { - print_api_list(undef, $data, $result_schema); + print_api_list($data, $result_schema); } else { foreach my $entry (@$data) { print data_to_text($entry) . "\n";