Skip to content

Commit

Permalink
Merge pull request #5679 from vkip/skip_empty_pos_args
Browse files Browse the repository at this point in the history
Skip empty positional arguments
  • Loading branch information
bska authored Jan 21, 2025
2 parents bf4a6a1 + 81de304 commit 4d91d68
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions opm/simulators/flow/FlowUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ void hideUnusedParameters()
Parameters::Hide<Parameters::UseAverageDensityMsWells>();
}

namespace {
bool isEmptyString(const std::string& str) {
return str.size()==0 || str=="\"\"" || str=="''";
}
}

int eclPositionalParameter(std::function<void(const std::string&, const std::string&)> addKey,
std::set<std::string>& seenParams,
std::string& errorMsg,
Expand All @@ -283,6 +289,9 @@ int eclPositionalParameter(std::function<void(const std::string&, const std::str
return 0;
}

if (isEmptyString(argv[paramIdx]))
return 1;

if (seenParams.count("EclDeckFileName") > 0) {
errorMsg =
"Parameter 'EclDeckFileName' specified multiple times"
Expand Down

0 comments on commit 4d91d68

Please sign in to comment.