From: root Date: Thu, 20 Jul 2017 13:06:06 +0000 (+0100) Subject: bin/ovh-api X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=8f7772f54157d24a62c09e4fd780ae71251b41e2;p=nb.git bin/ovh-api --- diff --git a/bin/ovh-api b/bin/ovh-api index 37ac1bca..fe681bc1 100755 --- a/bin/ovh-api +++ b/bin/ovh-api @@ -51,7 +51,7 @@ use OvhApi; my @KEY = (); init(); -@KEY or help(); +@KEY or help(9); open STDOUT,'| (which jq > /dev/null && jq . || cat)' if $Opt{jq}; my $Api = OvhApi->new(type => OvhApi::OVH_API_EU, applicationKey => $KEY[0], applicationSecret => $KEY[1], consumerKey => $KEY[2]); @@ -467,6 +467,7 @@ sub help { #------------------------------------------------------------------------------ # Print help and exit #------------------------------------------------------------------------------ +my $exit = @_ ? shift @_ : 0; require 'Pod/Usage.pm' unless $INC{'Pod/Usage.pm'}; require 'Pod/Perldoc.pm' unless $INC{'Pod/Perldoc.pm'}; @@ -501,7 +502,7 @@ sub help { close STDOUT; unlink $in_file if $in_file and -e $in_file; - exit 1; + exit $exit; } #------------------------------------------------------------------------------