]> git.proxmox.com Git - pve-client.git/blobdiff - PVE/APIClient/Commands/config.pm
fixes for changes in pve-common
[pve-client.git] / PVE / APIClient / Commands / config.pm
index 0b9b9aa82152bfee5399aa8f290e7ffcfc8a14da..89b4728de6c918ecb566a94af0dfb4815decb692 100644 (file)
@@ -9,6 +9,8 @@ use PVE::APIClient::JSONSchema qw(get_standard_option);
 use PVE::APIClient::Tools qw(extract_param);
 use PVE::APIClient::Config;
 
+use PVE::APIClient::CLIFormatter;
+use PVE::APIClient::RESTHandler;
 use PVE::APIClient::CLIHandler;
 
 use base qw(PVE::APIClient::CLIHandler);
@@ -23,6 +25,7 @@ __PACKAGE__->register_method ({
     description => "Dump default configuration.",
     parameters => {
        additionalProperties => 0,
+       properties => {},
     },
     returns => {
        type => 'object',
@@ -54,6 +57,9 @@ __PACKAGE__->register_method ({
 
        my $code = sub {
            my $config = PVE::APIClient::Config->load();
+
+           PVE::APIClient::Tools::assert_if_modified($config->{digest}, $digest);
+
            my $defaults = PVE::APIClient::Config->get_defaults($config);
 
            my $plugin = PVE::APIClient::Config->lookup('defaults');
@@ -87,7 +93,15 @@ __PACKAGE__->register_method ({
 
 our $cmddef = {
     set => [ __PACKAGE__, 'set',],
-    list => [__PACKAGE__, 'list', undef, undef, sub { PVE::APIClient::Helpers::print_result(@_);}],
+    list => [__PACKAGE__, 'list', undef, undef,
+            sub {
+                my ($data, $schema, $options) = @_;
+
+                PVE::APIClient::CLIFormatter::query_terminal_options($options);
+                PVE::APIClient::CLIFormatter::print_api_result($data, $schema, undef, $options);
+            },
+            $PVE::APIClient::RESTHandler::standard_output_options,
+       ],
 };
 
 1;