From da557f4967fda7f05c9e387560eb1e24140c1d59 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Thu, 6 Sep 2018 02:28:05 -0400 Subject: [PATCH] fix issue 5245, return 0 when pscp -h --- xCAT-client/bin/pscp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xCAT-client/bin/pscp b/xCAT-client/bin/pscp index 245f9598b..8d7e339cc 100755 --- a/xCAT-client/bin/pscp +++ b/xCAT-client/bin/pscp @@ -20,7 +20,7 @@ my $interface; GetOptions( "interface=s" => \$interface, "f|fanout=s" => \$fanout, - "h|help" => \$usage, + "h|help" => \&usage, "v|version" => \$::VERSION, ); my %nodehdl; @@ -32,9 +32,17 @@ if ($ENV{XCATHOST}) { sub usage { - print $_[0]; + my $rc = 1; + my @info = @_; + if (@info) { + if ($info[0] eq "h") { + $rc = 0; + } else { + print $info[0]; + } + } print "Usage: pscp [ -f fanout] [-i ] [SCP OPTIONS...] FILE... :\n"; - exit 1; + exit $rc; } my $pshmaxp = 64;