2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

Move the rpower usage checking under the rpower option

This commit is contained in:
Victor Hu 2017-03-20 12:10:03 -04:00
parent 57e90bbf96
commit 7b227192f6

View File

@ -279,16 +279,15 @@ sub parse_args {
return $check;
}
if (!defined($extrargs)) {
return ([ 1, "No option specified for rpower" ]);
}
if (scalar(@ARGV) > 1) {
return ([ 1, "Only one option is supported at the same time" ]);
}
my $subcommand = $ARGV[0];
if ($command eq "rpower") {
if (!defined($extrargs)) {
return ([ 1, "No option specified for rpower" ]);
}
unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) {
return ([ 1, "$subcommand is not supported for rpower" ]);
}