]> git.nbdom.net Git - nb.git/commitdiff
bin/ovh-api
authorroot <sys@15gifts.com>
Thu, 20 Jul 2017 13:06:06 +0000 (14:06 +0100)
committerroot <sys@15gifts.com>
Thu, 20 Jul 2017 13:06:06 +0000 (14:06 +0100)
bin/ovh-api

index 37ac1bcaef4060ccbb8c92bafaf5b6d92d86b762..fe681bc190b0e91b96a1b5a84cca4614bf90237e 100755 (executable)
@@ -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;
 }
 
 #------------------------------------------------------------------------------