From: Dietmar Maurer Date: Thu, 14 Jun 2018 09:57:40 +0000 (+0200) Subject: rename defaut output format from 'table' to 'text' X-Git-Url: https://git.proxmox.com/?p=pve-client.git;a=commitdiff_plain;h=b5aeedb0629a748eb3ac6d643c2c418d331fa57d;hp=4db9ff67bc9b370e179e568f102be9242323632a rename defaut output format from 'table' to 'text' --- diff --git a/PVE/APIClient/Commands/list.pm b/PVE/APIClient/Commands/list.pm index f12ef87..2030c51 100644 --- a/PVE/APIClient/Commands/list.pm +++ b/PVE/APIClient/Commands/list.pm @@ -31,7 +31,7 @@ __PACKAGE__->register_method ({ my $conn = PVE::APIClient::Config->remote_conn($config, $param->{remote}); my $resources = $conn->get('api2/json/cluster/resources', { type => 'vm' }); - if (!defined($param->{format}) or $param->{format} eq 'table') { + if (!defined($param->{format}) or $param->{format} eq 'text') { my $headers = ['Node', 'VMID', 'Type', 'Name', 'Status']; my $data = []; for my $el (@$resources) { diff --git a/PVE/APIClient/Config.pm b/PVE/APIClient/Config.pm index 3f2efe5..249ef83 100644 --- a/PVE/APIClient/Config.pm +++ b/PVE/APIClient/Config.pm @@ -28,9 +28,9 @@ my $complete_remote_name = sub { PVE::APIClient::JSONSchema::register_standard_option('pveclient-output-format', { type => 'string', description => 'Output format.', - enum => [ 'table', 'json' ], + enum => [ 'text', 'json' ], optional => 1, - default => 'table', + default => 'text', }); PVE::APIClient::JSONSchema::register_standard_option('pveclient-remote-name', { diff --git a/PVE/APIClient/Helpers.pm b/PVE/APIClient/Helpers.pm index 7aec160..cc19514 100644 --- a/PVE/APIClient/Helpers.pm +++ b/PVE/APIClient/Helpers.pm @@ -43,7 +43,7 @@ $build_pve_api_path_hash = sub { } }; -my $default_output_format = 'table'; +my $default_output_format = 'text'; my $client_output_format = $default_output_format; sub set_output_format { @@ -71,7 +71,7 @@ sub print_result { if ($format eq 'json') { print to_json($data, {utf8 => 1, allow_nonref => 1, canonical => 1, pretty => 1 }); - } elsif ($format eq 'table') { + } elsif ($format eq 'text') { my $type = $result_schema->{type}; if ($type eq 'object') { die "implement me";