Store unhandled command-line arguments.
A new method ParameterGroup::unhandledArguments() is available to access the list of unhandled arguments. Before, when such arguments were encountered they were ignored and a warning was printed to standard out. Apart from the lack of a (potentially misleading) warning, this should not change the behaviour of existing clients of the class.
This commit is contained in:
@@ -329,5 +329,10 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<std::string> ParameterGroup::unhandledArguments() const
|
||||
{
|
||||
return unhandled_arguments_;
|
||||
}
|
||||
|
||||
} // namespace parameter
|
||||
} // namespace Opm
|
||||
|
||||
@@ -267,6 +267,9 @@ namespace Opm {
|
||||
/// Insert a new parameter item into the group.
|
||||
void insertParameter(const std::string& name, const std::string& value);
|
||||
|
||||
/// Unhandled arguments from command line parsing.
|
||||
const std::vector<std::string> unhandledArguments() const;
|
||||
|
||||
private:
|
||||
typedef std::shared_ptr<ParameterMapItem> data_type;
|
||||
typedef std::pair<std::string, data_type> pair_type;
|
||||
@@ -276,6 +279,7 @@ namespace Opm {
|
||||
map_type map_;
|
||||
const ParameterGroup* parent_;
|
||||
bool output_is_enabled_;
|
||||
std::vector<std::string> unhandled_arguments_;
|
||||
|
||||
template<typename T, class Requirement>
|
||||
T translate(const pair_type& data, const Requirement& chk) const;
|
||||
|
||||
@@ -150,9 +150,7 @@ namespace Opm {
|
||||
} else if (file_type.second == "param") {
|
||||
this->readParam(files[i]);
|
||||
} else {
|
||||
std::cout << "WARNING: Ignoring file '"
|
||||
<< files[i] << "' with unknown extension.\n"
|
||||
<< "Valid filename extensions are 'xml' and 'param'.\n";
|
||||
unhandled_arguments_.push_back(files[i]);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < int(assignments.size()); ++i) {
|
||||
|
||||
Reference in New Issue
Block a user