From 89120cf7addb304c1d1b029f1edae108e94ba023 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Apr 2013 13:53:51 +0200 Subject: Make --changelog{,-in,-out,-dir} per-database --- odb/generator.cxx | 16 +++++++++------- odb/option-types.hxx | 1 - odb/options.cli | 8 ++++---- odb/validator.cxx | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) (limited to 'odb') 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 #include - #include #include 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 --changelog { "", "Read/write changelog from/to 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 --changelog-in { "", "Read changelog from 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 --changelog-out { "", "Write changelog to 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 --changelog-dir { "", "Use 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; -- cgit v1.1