]> git.proxmox.com Git - pve-client.git/blobdiff - PVE/APIClient/Config.pm
rename defaut output format from 'table' to 'text'
[pve-client.git] / PVE / APIClient / Config.pm
index 7189d8e41c3ab74c90f6cb16e5a8a43b26eded65..249ef83ceaebb801700232c6a925a76440c4c270 100644 (file)
@@ -4,11 +4,12 @@ use strict;
 use warnings;
 use JSON;
 
-use PVE::JSONSchema;
-use PVE::SectionConfig;
+use PVE::APIClient::JSONSchema;
+use PVE::APIClient::SectionConfig;
+use PVE::APIClient::PTY;
 use PVE::APIClient::Tools qw(file_get_contents file_set_contents);
 
-use base qw(PVE::SectionConfig);
+use base qw(PVE::APIClient::SectionConfig);
 
 my $remote_namne_regex = qw(\w+);
 
@@ -24,7 +25,15 @@ my $complete_remote_name = sub {
     return $list;
 };
 
-PVE::JSONSchema::register_standard_option('pveclient-remote-name', {
+PVE::APIClient::JSONSchema::register_standard_option('pveclient-output-format', {
+    type => 'string',
+    description => 'Output format.',
+    enum => [ 'text', 'json' ],
+    optional => 1,
+    default => 'text',
+});
+
+PVE::APIClient::JSONSchema::register_standard_option('pveclient-remote-name', {
     description => "The name of the remote.",
     type => 'string',
     pattern => $remote_namne_regex,
@@ -135,7 +144,7 @@ sub remote_conn {
 
     my $password = $section->{password};
     if (!defined($password)) {
-       $password = PVE::PTY::read_password("Remote password: ")
+       $password = PVE::APIClient::PTY::read_password("Remote password: ")
     }
 
     my $conn = PVE::APIClient::LWP->new(
@@ -158,8 +167,8 @@ package PVE::APIClient::RemoteConfig;
 use strict;
 use warnings;
 
-use PVE::JSONSchema qw(register_standard_option get_standard_option);
-use PVE::SectionConfig;
+use PVE::APIClient::JSONSchema qw(register_standard_option get_standard_option);
+use PVE::APIClient::SectionConfig;
 
 use base qw( PVE::APIClient::Config);
 
@@ -225,7 +234,7 @@ package PVE::APIClient::DefaultsConfig;
 use strict;
 use warnings;
 
-use PVE::JSONSchema qw(register_standard_option get_standard_option);
+use PVE::APIClient::JSONSchema qw(register_standard_option get_standard_option);
 
 use base qw( PVE::APIClient::Config);