From 1eaebfd18f71baa384c5117645fbb461b38fc2fe Mon Sep 17 00:00:00 2001 From: linggao Date: Tue, 9 Nov 2010 15:28:03 +0000 Subject: [PATCH] fix a user reported problem for updatenode usage git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8103 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/updatenode | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/xCAT-client/bin/updatenode b/xCAT-client/bin/updatenode index 66650e10a..831e7b7db 100755 --- a/xCAT-client/bin/updatenode +++ b/xCAT-client/bin/updatenode @@ -28,26 +28,13 @@ if (-p STDIN) { while ( ) { $data.=$_; } $cmdref->{stdin}->[0]=$data; } - Getopt::Long::Configure("posix_default"); Getopt::Long::Configure("no_gnu_compat"); Getopt::Long::Configure("bundling"); -GetOptions('h|help' => \$::HELP, - 'v|version' => \$::VERSION); +#GetOptions('h|help' => \$::HELP, +# 'v|version' => \$::VERSION); # display the usage if -h or --help is specified -if ($::HELP) -{ - &updatenode_usage($callback); - exit 0; -} -# display the version statement if -v or --verison is specified -if ($::VERSION) -{ - my $version = xCAT::Utils->Version(); - print "$version\n"; - exit 0; -} my $arg=shift(@ARGV); @@ -100,6 +87,20 @@ if ( exit 1; } +if ($::HELP) +{ + &updatenode_usage($callback); + exit 0; +} + +# display the version statement if -v or --verison is specified +if ($::VERSION) +{ + my $version = xCAT::Utils->Version(); + print "$version\n"; + exit 0; +} + my $current_userid = getpwuid($>); $ENV{DSH_FROM_USERID} = $current_userid; my $to_userid;