mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Eliminate config includes, as nothing uses them any more and it just makes
things like documentation generation hard.
This commit is contained in:
@@ -17,7 +17,6 @@ message ConfigProto
|
||||
{
|
||||
optional string comment = 8;
|
||||
optional bool is_extension = 13;
|
||||
repeated string include = 19;
|
||||
repeated string documentation = 23;
|
||||
|
||||
optional LayoutProto layout = 18;
|
||||
|
||||
21
lib/flags.cc
21
lib/flags.cc
@@ -53,11 +53,6 @@ void FlagGroup::applyOption(const OptionProto& option)
|
||||
"option '{}' has an option group inside it, which isn't "
|
||||
"allowed",
|
||||
option.name());
|
||||
if (option.config().include_size() > 0)
|
||||
Error() << fmt::format(
|
||||
"option '{}' is trying to include something, which "
|
||||
"isn't allowed",
|
||||
option.name());
|
||||
|
||||
Logger() << fmt::format("OPTION: {}",
|
||||
option.has_message() ? option.message() : option.comment());
|
||||
@@ -316,21 +311,7 @@ ConfigProto FlagGroup::parseSingleConfigFile(const std::string& filename,
|
||||
void FlagGroup::parseConfigFile(const std::string& filename,
|
||||
const std::map<std::string, const ConfigProto*>& configFiles)
|
||||
{
|
||||
auto newConfig = parseSingleConfigFile(filename, configFiles);
|
||||
|
||||
/* The includes need to be merged _first_. */
|
||||
|
||||
for (const auto& include : newConfig.include())
|
||||
{
|
||||
auto included = parseSingleConfigFile(include, configFiles);
|
||||
if (included.include_size() != 0)
|
||||
Error() << "only one level of config file includes are supported "
|
||||
"(so far, if you need this, complain)";
|
||||
|
||||
config.MergeFrom(included);
|
||||
}
|
||||
|
||||
config.MergeFrom(newConfig);
|
||||
config.MergeFrom(parseSingleConfigFile(filename, configFiles));
|
||||
}
|
||||
|
||||
void FlagGroup::checkInitialised() const
|
||||
|
||||
@@ -89,25 +89,13 @@ static void validateConfigWithOptions(std::string baseConfigName,
|
||||
|
||||
static void validateToplevelConfig(std::string name)
|
||||
{
|
||||
ConfigProto toplevel = findConfig(name);
|
||||
ConfigProto config = findConfig(name);
|
||||
|
||||
/* Don't test extension configs. */
|
||||
|
||||
if (toplevel.is_extension())
|
||||
if (config.is_extension())
|
||||
return;
|
||||
|
||||
/* Apply any includes. */
|
||||
|
||||
ConfigProto config;
|
||||
for (const auto& include : toplevel.include())
|
||||
{
|
||||
ConfigProto included = findConfig(include);
|
||||
if (included.include_size() != 0)
|
||||
error("{}: extension config contains _includes", include);
|
||||
config.MergeFrom(included);
|
||||
}
|
||||
config.MergeFrom(toplevel);
|
||||
|
||||
/* Collate options. */
|
||||
|
||||
std::map<std::string, const OptionProto*> optionProtos;
|
||||
|
||||
Reference in New Issue
Block a user