]> git.proxmox.com Git - pve-client.git/blobdiff - PVE/APIClient/Commands/list.pm
rename defaut output format from 'table' to 'text'
[pve-client.git] / PVE / APIClient / Commands / list.pm
index 2190ad6346ffbb6c3a40b8eed8f2d57a801160d1..2030c515423d0fecbd393a1395e37da62562785c 100644 (file)
@@ -6,6 +6,9 @@ use JSON;
 
 use PVE::APIClient::JSONSchema qw(get_standard_option);
 
+use PVE::APIClient::Config;
+use PVE::APIClient::CLIHandler;
+
 use base qw(PVE::APIClient::CLIHandler);
 
 __PACKAGE__->register_method ({
@@ -17,13 +20,7 @@ __PACKAGE__->register_method ({
        additionalProperties => 0,
        properties => {
            remote => get_standard_option('pveclient-remote-name'),
-           format => {
-               type => 'string',
-               description => 'Output format',
-               enum => [ 'table', 'json' ],
-               optional => 1,
-               default => 'table',
-           }
+           format => get_standard_option('pveclient-output-format'),
        },
     },
     returns => { type => 'null'},
@@ -34,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) {
@@ -55,4 +52,4 @@ __PACKAGE__->register_method ({
 
 our $cmddef = [ __PACKAGE__, 'list', ['remote']];
 
-1;
\ No newline at end of file
+1;