From 8f7772f54157d24a62c09e4fd780ae71251b41e2 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Jul 2017 14:06:06 +0100 Subject: [PATCH] bin/ovh-api --- bin/ovh-api | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } #------------------------------------------------------------------------------ -- 2.47.3