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;