mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-07 05:13:16 +00:00
PVE::CLIHandler::print_api_list - reorder arguments
Move optional argument to the end.
This commit is contained in:
parent
eb04f1e26c
commit
8587474c36
@ -493,7 +493,7 @@ sub print_text_table {
|
|||||||
# prints the result of an API GET call returning an array
|
# prints the result of an API GET call returning an array
|
||||||
# and to have the results key of the API call defined.
|
# and to have the results key of the API call defined.
|
||||||
sub print_api_list {
|
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';
|
die "can only print array result" if $returninfo->{type} ne 'array';
|
||||||
|
|
||||||
@ -539,7 +539,7 @@ sub print_api_result {
|
|||||||
return if !scalar(@$data);
|
return if !scalar(@$data);
|
||||||
my $item_type = $result_schema->{items}->{type};
|
my $item_type = $result_schema->{items}->{type};
|
||||||
if ($item_type eq 'object') {
|
if ($item_type eq 'object') {
|
||||||
print_api_list(undef, $data, $result_schema);
|
print_api_list($data, $result_schema);
|
||||||
} else {
|
} else {
|
||||||
foreach my $entry (@$data) {
|
foreach my $entry (@$data) {
|
||||||
print data_to_text($entry) . "\n";
|
print data_to_text($entry) . "\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user