aboutsummaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-03-04 13:05:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-03-04 13:05:57 +0200
commitba2b1039c37e3a18589f78c1508fd503be70b262 (patch)
tree3094c9a7f9ac2b06af25411b1612701c61e3fd27 /odb
parente21a730c1fc4e199fb9b3c812a070788527b4c0e (diff)
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.
Diffstat (limited to 'odb')
-rw-r--r--odb/odb.cxx12
1 files 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));