aboutsummaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-04-26 13:53:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-26 13:53:51 +0200
commit89120cf7addb304c1d1b029f1edae108e94ba023 (patch)
tree574007f6b3691b8ae8ce504eb2f1a6a019456787 /odb
parent377bfe7de7fd4305ea1ecc4ab1a361fa989a80d7 (diff)
Make --changelog{,-in,-out,-dir} per-database
Diffstat (limited to 'odb')
-rw-r--r--odb/generator.cxx16
-rw-r--r--odb/option-types.hxx1
-rw-r--r--odb/options.cli8
-rw-r--r--odb/validator.cxx2
4 files changed, 14 insertions, 13 deletions
diff --git a/odb/generator.cxx b/odb/generator.cxx
index a4e1303..3b50299 100644
--- a/odb/generator.cxx
+++ b/odb/generator.cxx
@@ -167,17 +167,19 @@ generate (options const& ops,
string base (file.base ().string ());
path in_log_path;
- path log_dir (ops.changelog_dir ().empty () ? "" : ops.changelog_dir ());
- if (ops.changelog_in_specified ())
+ path log_dir (ops.changelog_dir ().count (db) != 0
+ ? ops.changelog_dir ()[db]
+ : "");
+ if (ops.changelog_in ().count (db) != 0)
{
- in_log_path = path (ops.changelog_in ());
+ in_log_path = path (ops.changelog_in ()[db]);
if (!log_dir.empty () && !in_log_path.absolute ())
in_log_path = log_dir / in_log_path;
}
- else if (ops.changelog_specified ())
+ else if (ops.changelog ().count (db) != 0)
{
- in_log_path = path (ops.changelog ());
+ in_log_path = path (ops.changelog ()[db]);
if (!in_log_path.absolute () && !log_dir.empty ())
in_log_path = log_dir / in_log_path;
@@ -202,9 +204,9 @@ generate (options const& ops,
string old_changelog_xml;
path out_log_path;
- if (ops.changelog_out_specified ())
+ if (ops.changelog_out ().count (db))
{
- out_log_path = path (ops.changelog_out ());
+ out_log_path = path (ops.changelog_out ()[db]);
if (!log_dir.empty () && !out_log_path.absolute ())
out_log_path = log_dir / out_log_path;
diff --git a/odb/option-types.hxx b/odb/option-types.hxx
index f078d3c..5e4497a 100644
--- a/odb/option-types.hxx
+++ b/odb/option-types.hxx
@@ -10,7 +10,6 @@
#include <string>
#include <cassert>
-
#include <odb/semantics/relational/name.hxx>
#include <odb/semantics/relational/deferrable.hxx>
diff --git a/odb/options.cli b/odb/options.cli
index 63bbbb8..c56ee28 100644
--- a/odb/options.cli
+++ b/odb/options.cli
@@ -331,7 +331,7 @@ class options
combined file. Refer to the \cb{--at-once} option for details."
};
- std::string --changelog
+ database_map<std::string> --changelog
{
"<file>",
"Read/write changelog from/to <file> instead of the default changelog
@@ -344,7 +344,7 @@ class options
options to specify different input and output chaneglog files."
};
- std::string --changelog-in
+ database_map<std::string> --changelog-in
{
"<file>",
"Read changelog from <file> instead of the default changelog file. If
@@ -352,7 +352,7 @@ class options
chanegelog file with \cb{--changelog-out}."
};
- std::string --changelog-out
+ database_map<std::string> --changelog-out
{
"<file>",
"Write changelog to <file> instead of the default changelog file. If
@@ -360,7 +360,7 @@ class options
chanegelog file with \cb{--changelog-in}."
};
- std::string --changelog-dir
+ database_map<std::string> --changelog-dir
{
"<dir>",
"Use <dir> instead of the input file directory as the changelog file
diff --git a/odb/validator.cxx b/odb/validator.cxx
index f33962b..efe9236 100644
--- a/odb/validator.cxx
+++ b/odb/validator.cxx
@@ -995,7 +995,7 @@ validate (options const& ops,
// Changelog options.
//
- if (ops.changelog_in_specified () != ops.changelog_out_specified ())
+ if (ops.changelog_in ().count (db) != ops.changelog_out ().count (db))
{
cerr << "error: both --changelog-in and --changelog-out must be " <<
"specified" << endl;