mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
init: Added command line configuration override support
This commit is contained in:
parent
20a77c7d53
commit
0128087a86
1 changed files with 10 additions and 0 deletions
10
src/init.cpp
10
src/init.cpp
|
@ -183,6 +183,16 @@ void initializeDataAndRules (
|
|||
if (rules.has ("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.
|
||||
database.initialize (data._data);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue