From 7b5e1345b5a5b16bac4d29313995ae6e9dab8b56 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sat, 4 Feb 2017 21:38:01 +0000 Subject: [PATCH] bin/ovh-api --- bin/ovh-api | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ovh-api b/bin/ovh-api index 338e815d..e170c42a 100755 --- a/bin/ovh-api +++ b/bin/ovh-api @@ -81,7 +81,6 @@ if (@ARGV and $ARGV[0] =~ /^(\w+):(\w+)(?::(\w+))?$/) { } @KEY or help(); -help() unless @ARGV; my $Api = OvhApi->new(type => OvhApi::OVH_API_EU, applicationKey => $KEY[0], applicationSecret => $KEY[1], consumerKey => $KEY[2]); # Auth @@ -90,6 +89,7 @@ if (@KEY < 3) { method => 'ALL', path => '/*', }]); + die "Error" unless $Answer; if ($Answer) { my ($consumerKey, $validationUrl) = @{ $Answer->content}{qw{ consumerKey validationUrl }}; push @KEY, $consumerKey; @@ -104,6 +104,7 @@ if (@KEY < 3) { } # Query +help() unless @ARGV; my $URL = shift @ARGV or help(); my $BODY = @ARGV ? shift(@ARGV) : {}; #use Data::Dumper; die Dumper(JSON::encode_json($BODY)); -- 2.47.3