diff --git a/src/CLI.cpp b/src/CLI.cpp index 1d8157fa9..25cf561da 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -354,6 +354,22 @@ void CLI::analyze (bool parse /* = true */) context.debug ("CLI::analyze end"); } +//////////////////////////////////////////////////////////////////////////////// +void CLI::applyOverrides () +{ + std::vector ::const_iterator a; + for (a = _args.begin (); a != _args.end (); ++a) + { + if (a->hasTag ("CONFIG")) + { + std::string name = a->attribute ("name"); + std::string value = a->attribute ("value"); + context.config.set (name, value); + context.footnote (format (STRING_PARSER_OVERRIDE_RC, name, value)); + } + } +} + //////////////////////////////////////////////////////////////////////////////// void CLI::getOverride (std::string& home, File& rc) { diff --git a/src/CLI.h b/src/CLI.h index 3290bed2e..480a070c5 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -71,6 +71,7 @@ public: void initialize (int, const char**); void add (const std::string&); void analyze (bool parse = true); + void applyOverrides (); void getOverride (std::string&, File&); void getDataLocation (Path&); const std::string getFilter (); diff --git a/src/Context.cpp b/src/Context.cpp index ca3d9946d..f8c71e1bb 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -177,7 +177,7 @@ int Context::initialize (int argc, const char** argv) } // Create missing config file and data directory, if necessary. - parser.applyOverrides (); + cli.applyOverrides (); // Setting the debug switch has ripple effects. propagateDebug ();