init: Added command line configuration override support

This commit is contained in:
Paul Beckingham 2016-05-29 11:29:55 -04:00
parent 20a77c7d53
commit 0128087a86

View file

@ -183,6 +183,16 @@ void initializeDataAndRules (
if (rules.has ("debug.indicator")) if (rules.has ("debug.indicator"))
setDebugIndicator (rules.get ("debug.indicator")); setDebugIndicator (rules.get ("debug.indicator"));
// Apply command line overrides.
for (auto& arg : cli._args)
{
if (arg.hasTag ("CONFIG"))
{
rules.set (arg.attribute ("name"), arg.attribute ("value"));
debug (format ("Configuration override {1} = {2}", arg.attribute ("name"), arg.attribute ("value")));
}
}
// Initialize the database (no data read), but files are enumerated. // Initialize the database (no data read), but files are enumerated.
database.initialize (data._data); database.initialize (data._data);