5
0
mirror of git://git.proxmox.com/git/pve-zsync.git synced 2025-01-18 14:03:35 +03:00

Remove switch module.

Switch module is moved out the perl core.
This commit is contained in:
Wolfgang Link 2016-08-02 11:41:45 +02:00 committed by Dietmar Maurer
parent c0cf39ec6d
commit c8c745ec98

View File

@ -7,7 +7,6 @@ use Fcntl qw(:flock SEEK_END);
use Getopt::Long qw(GetOptionsFromArray);
use File::Copy qw(move);
use File::Path qw(make_path);
use Switch;
use JSON;
use IO::File;
use String::ShellQuote 'shell_quote';
@ -1075,39 +1074,30 @@ sub send_image {
sub help {
my ($command) = @_;
switch($command){
case 'help'
{
if ($command eq 'help') {
die "$help_help\n";
}
case 'sync'
{
} elsif ($command eq 'sync') {
die "$help_sync\n";
}
case 'destroy'
{
} elsif ($command eq 'destroy') {
die "$help_destroy\n";
}
case 'create'
{
} elsif ($command eq 'create') {
die "$help_create\n";
}
case 'list'
{
} elsif ($command eq 'list') {
die "$help_list\n";
}
case 'status'
{
} elsif ($command eq 'status') {
die "$help_status\n";
}
case 'enable'
{
} elsif ($command eq 'enable') {
die "$help_enable\n";
}
case 'disable'
{
die "$help_enable\n";
}
} elsif ($command eq 'disable') {
die "$help_disable\n";
}
}
@ -1115,60 +1105,59 @@ sub send_image {
my @arg = @ARGV;
my $param = parse_argv(@arg);
switch($command) {
case "destroy"
{
if ($command eq 'destroy') {
die "$help_destroy\n" if !$param->{source};
check_target($param->{source});
destroy_job($param);
}
case "sync"
{
} elsif ($command eq 'sync') {
die "$help_sync\n" if !$param->{source} || !$param->{dest};
check_target($param->{source});
check_target($param->{dest});
sync($param);
}
case "create"
{
} elsif ($command eq 'create') {
die "$help_create\n" if !$param->{source} || !$param->{dest};
check_target($param->{source});
check_target($param->{dest});
init($param);
}
case "status"
{
} elsif ($command eq 'status') {
print status();
}
case "list"
{
} elsif ($command eq 'list') {
print list();
}
case "help"
{
} elsif ($command eq 'help') {
my $help_command = $ARGV[1];
if ($help_command && $commands->{$help_command}) {
print help($help_command);
}
if ($param->{verbose} == 1){
exec("man $PROGNAME");
} else {
usage(1);
}
}
case "enable"
{
} elsif ($command eq 'enable') {
die "$help_enable\n" if !$param->{source};
check_target($param->{source});
enable_job($param);
}
case "disable"
{
} elsif ($command eq 'disable') {
die "$help_disable\n" if !$param->{source};
check_target($param->{source});
disable_job($param);
}
}
sub usage {