Commit a82d864c authored by Max Kellermann's avatar Max Kellermann

config/File: print warning about deprecated options

parent dcac32a6
......@@ -116,6 +116,11 @@ ReadConfigBlock(ConfigData &config_data, BufferedReader &reader,
const unsigned i = unsigned(o);
const ConfigTemplate &option = config_block_templates[i];
if (option.deprecated)
FormatWarning(config_file_domain,
"config parameter \"%s\" on line %u is deprecated",
name, reader.GetLineNumber());
if (!option.repeatable)
if (const auto *block = config_data.GetBlock(o))
throw FormatRuntimeError("config parameter \"%s\" is first defined "
......@@ -143,6 +148,11 @@ ReadConfigParam(ConfigData &config_data, BufferedReader &reader,
const unsigned i = unsigned(o);
const ConfigTemplate &option = config_param_templates[i];
if (option.deprecated)
FormatWarning(config_file_domain,
"config parameter \"%s\" on line %u is deprecated",
name, reader.GetLineNumber());
if (!option.repeatable)
if (const auto *param = config_data.GetParam(o))
throw FormatRuntimeError("config parameter \"%s\" is first defined "
......
......@@ -24,7 +24,6 @@ struct ConfigTemplate {
const char *const name;
const bool repeatable;
// TODO: print warning when a deprecated option is used
const bool deprecated;
constexpr ConfigTemplate(const char *_name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment