2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-13 18:00:38 +00:00

Fix the code to handle multiple activate, found bug with UT cases

This commit is contained in:
Victor Hu
2017-12-15 16:55:32 -05:00
parent 0584a21272
commit 6ee77f1fbb

View File

@ -1180,7 +1180,10 @@ sub parse_args {
}
if (scalar @flash_arguments > 1) {
if ($filename_passed and $option_flag !~ /^-d$/) {
if (($option_flag =~ /^-a$|^--delete$/) or ($filename_passed and $option_flag !~ /^-d$/)) {
# Handles:
# - Multiple options not supported to activate/delete at the same time
# - Filename passed in and option is not -d for directory
return ([1, "More than one firmware specified is not supported."]);
} elsif ($option_flag =~ /^-d$/) {
return ([1, "More than one directory specified is not supported."]);