From ba2b1039c37e3a18589f78c1508fd503be70b262 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 4 Mar 2014 13:05:57 +0200 Subject: Pass database we are compiling for to plugin explicitly as first argument Rather than relying on it being specified in the command line which may not be the case -- the option could be specified in an options file. --- odb/odb.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/odb/odb.cxx b/odb/odb.cxx index dd7c951..1036c4c 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -681,6 +681,12 @@ main (int argc, char* argv[]) // Encode plugin options. // + // Add the database we are compiling for first. More databases + // could be specified in options files but they will be ignored + // by the plugin (it only cares about the first). + // + db_args.push_back (encode_plugin_option ("database", db.string ())); + cli::options const& desc (options::description ()); for (size_t i (0); i < end; ++i) { @@ -699,11 +705,7 @@ main (int argc, char* argv[]) { // Ignore all other databases. // - if (plugin_args[i + 1] != db.string ()) - { - ++i; - continue; - } + continue; } cli::options::const_iterator it (desc.find (a)); -- cgit v1.1