remove PVE/APIClient/Commands/help.pm
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 13 Jun 2018 06:57:53 +0000 (08:57 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 13 Jun 2018 06:57:53 +0000 (08:57 +0200)
not needed anymore.

Makefile
PVE/APIClient/Commands/help.pm [deleted file]
pveclient

index a59018d..6aa2d4c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,6 @@ install:  pve-api-definition.dat
        install -D -m 0644 PVE/APIClient/Config.pm ${LIB_DIR}/PVE/APIClient/Config.pm
        install -D -m 0644 PVE/APIClient/Commands/remote.pm ${LIB_DIR}/PVE/APIClient/Commands/remote.pm
        install -D -m 0644 PVE/APIClient/Commands/lxc.pm ${LIB_DIR}/PVE/APIClient/Commands/lxc.pm
-       install -D -m 0644 PVE/APIClient/Commands/help.pm ${LIB_DIR}/PVE/APIClient/Commands/help.pm
        install -D -m 0644 pve-api-definition.dat ${LIB_DIR}/pve-api-definition.dat
        install -D -m 0755 pveclient ${DESTDIR}/usr/bin/pveclient
        install -D -m 0644 pveclient.bash-completion ${BASHCOMPLDIR}/pveclient
diff --git a/PVE/APIClient/Commands/help.pm b/PVE/APIClient/Commands/help.pm
deleted file mode 100644 (file)
index efb964a..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-package PVE::APIClient::Commands::help;
-
-use strict;
-use warnings;
-
-use PVE::APIClient::Commands::help;
-use PVE::APIClient::Commands::list;
-use PVE::APIClient::Commands::lxc;
-use PVE::APIClient::Commands::config;
-use PVE::APIClient::Commands::remote;
-
-use PVE::CLIHandler;
-
-use base qw(PVE::CLIHandler);
-
-__PACKAGE__->register_method ({
-    name => 'help',
-    path => 'help',
-    method => 'GET',
-    description => "Print usage information.",
-    parameters => {
-       additionalProperties => 0,
-       properties => {
-           verbose => {
-               description => "Verbose output - list all options.",
-               type => 'boolean',
-               optional => 1,
-               default => 0,
-           },
-       },
-    },
-    returns => { type => 'null'},
-    code => sub {
-       my ($param) = @_;
-
-       my $text = "USAGE: pveclient <cmd> ...\n\n" if !$param->{verbose};
-
-       my $format = $param->{verbose} ? 'full' : 'short';
-
-       my $assemble_usage_string = sub {
-           my ($subcommand, $def) = @_;
-
-           my $sortfunc = sub { sort keys %{$_[0]} };
-
-           if (ref($def) eq 'HASH') {
-               foreach my $cmd (&$sortfunc($def)) {
-
-                   if (ref($def->{$cmd}) eq 'ARRAY') {
-                       my ($class, $name, $arg_param, $fixed_param) = @{$def->{$cmd}};
-                       $text .= $class->usage_str($name, "pveclient $subcommand $name", $arg_param, $fixed_param, $format, $class->can('read_password'));
-                   }
-               }
-           } else {
-               my ($class, $name, $arg_param, $fixed_param) = @$def;
-               $text .= $class->usage_str($name, "pveclient $name", $arg_param, $fixed_param, $format);
-           }
-       };
-
-       $assemble_usage_string->('help', $PVE::APIClient::Commands::help::cmddef);
-       $assemble_usage_string->('list', $PVE::APIClient::Commands::list::cmddef);
-       $assemble_usage_string->('lxc', $PVE::APIClient::Commands::lxc::cmddef);
-       $assemble_usage_string->('remote', $PVE::APIClient::Commands::remote::cmddef);
-       $assemble_usage_string->('config', $PVE::APIClient::Commands::config::cmddef);
-
-       $text .= "pveclient <get/set/create/delete> <path> {options}\n\n";
-
-       print STDERR $text;
-
-       return undef;
-    }});
-
-our $cmddef = [ __PACKAGE__, 'help', []];
-
-1;
index 8ef37a9..8b07853 100755 (executable)
--- a/pveclient
+++ b/pveclient
@@ -18,7 +18,6 @@ use PVE::APIClient::Commands::config;
 use PVE::APIClient::Commands::remote;
 use PVE::APIClient::Commands::list;
 use PVE::APIClient::Commands::lxc;
-use PVE::APIClient::Commands::help;
 use PVE::APIClient::Commands::start;
 
 use JSON;