better error messages when no command is given to zmcontrol
This commit is contained in:
parent
af6ead60a5
commit
55b1d29927
|
@ -29,7 +29,7 @@ use Getopt::Long;
|
||||||
use autouse 'Pod::Usage'=>qw(pod2usage);
|
use autouse 'Pod::Usage'=>qw(pod2usage);
|
||||||
use POSIX qw/strftime EPIPE/;
|
use POSIX qw/strftime EPIPE/;
|
||||||
use Socket;
|
use Socket;
|
||||||
#use Data::Dumper;
|
use Data::Dumper;
|
||||||
use Module::Load::Conditional qw{can_load};
|
use Module::Load::Conditional qw{can_load};
|
||||||
|
|
||||||
use constant MAX_CONNECT_DELAY => 15;
|
use constant MAX_CONNECT_DELAY => 15;
|
||||||
|
@ -173,14 +173,17 @@ if ( $options{command} ) {
|
||||||
next if !$message;
|
next if !$message;
|
||||||
|
|
||||||
my $params = jsonDecode($message);
|
my $params = jsonDecode($message);
|
||||||
#Debug( Dumper( $params ) );
|
Debug( Dumper( $params ) );
|
||||||
|
|
||||||
my $command = $params->{command};
|
my $command = $params->{command};
|
||||||
close( CLIENT );
|
close(CLIENT);
|
||||||
if ( $command eq 'quit' ) {
|
if ( $command eq 'quit' ) {
|
||||||
last;
|
last;
|
||||||
|
} elsif ( $command ) {
|
||||||
|
$control->$command($params);
|
||||||
|
} else {
|
||||||
|
Warning("No command in $message");
|
||||||
}
|
}
|
||||||
$control->$command($params);
|
|
||||||
} else {
|
} else {
|
||||||
Fatal('Bogus descriptor');
|
Fatal('Bogus descriptor');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue