mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Skip empty positional arguments
This commit is contained in:
parent
585627295f
commit
81de304642
@ -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,
|
||||
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user