From 50864280f972a521da90e0184a8440e04b31f7c6 Mon Sep 17 00:00:00 2001 From: bybai Date: Wed, 2 Dec 2015 02:32:32 -0500 Subject: [PATCH] fix psh/pscp -v and -h --- xCAT-client/bin/pscp | 4 ++++ xCAT-client/bin/psh | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-client/bin/pscp b/xCAT-client/bin/pscp index 18c8a56d6..51603f1d1 100755 --- a/xCAT-client/bin/pscp +++ b/xCAT-client/bin/pscp @@ -5,6 +5,7 @@ BEGIN $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; +use xCAT::Utils; use IO::Socket::SSL; use XML::Simple; $XML::Simple::PREFERRED_PARSER='XML::Parser'; @@ -18,9 +19,12 @@ my $interface; GetOptions( "interface=s" => \$interface, "f|fanout=s" => \$fanout, + "h|help" => \$usage, + "v|version" => \$::VERSION, ); my %nodehdl; my $xcathost='localhost:3001'; +if ($::VERSION) {print xCAT::Utils->Version() . "\n"; exit 0} if ($ENV{XCATHOST}) { $xcathost=$ENV{XCATHOST}; } diff --git a/xCAT-client/bin/psh b/xCAT-client/bin/psh index 2e18cdd36..ef00375b6 100755 --- a/xCAT-client/bin/psh +++ b/xCAT-client/bin/psh @@ -12,6 +12,7 @@ use IO::Socket::SSL; use XML::Simple; $XML::Simple::PREFERRED_PARSER='XML::Parser'; #use Data::Dumper; +use xCAT::Utils; use IO::Handle; use IO::Select; use Getopt::Long; @@ -30,9 +31,13 @@ if (!GetOptions( 'f|fanout=s' => \$fanout, "nonodecheck" => \$::NONODECHECK, #does not check the noderange, in this case, noderange need to be a list of nodes. 'h|help' => \$help, - ) || $help || scalar(@ARGV)<2 ) { - print "Usage: psh [-i ] [-l ] [-f ] [--nonodecheck] [-t ] \n"; - exit; + "v|version" => \$::VERSION, + ) || scalar(@ARGV)<2 ) { + if ($::VERSION) {print xCAT::Utils->Version() . "\n"; exit 0} + if ($help) { + print "Usage: psh [-i ] [-l ] [-f ] [--nonodecheck] [-t ] \n"; + exit; + } } my %nodehdl; my $xcathost='localhost:3001';