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:
parent
57e90bbf96
commit
7b227192f6
@ -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" ]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user