diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-09-12 14:28:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-09-12 14:28:03 +0200 |
commit | c0931400a1c5f02cf145c90fd7e34216836efd88 (patch) | |
tree | 5e13c5864e5f3c944a316f9189eb87976c8908c0 /odb/validator.cxx | |
parent | f01ad68661d62af62087b7b1ae29628f028e9eaa (diff) |
Implement --output-name, --generate-schema-only, and --at-once options
Diffstat (limited to 'odb/validator.cxx')
-rw-r--r-- | odb/validator.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/odb/validator.cxx b/odb/validator.cxx index 225a2a1..aba82a5 100644 --- a/odb/validator.cxx +++ b/odb/validator.cxx @@ -573,7 +573,7 @@ namespace // Update features set based on this object. // - if (class_file (c) == unit.file ()) + if (options.at_once () || class_file (c) == unit.file ()) { if (poly_root != 0) features.polymorphic_object = true; @@ -706,7 +706,7 @@ namespace // Update features set based on this view. // - if (class_file (c) == unit.file ()) + if (options.at_once () || class_file (c) == unit.file ()) { features.view = true; } @@ -1251,6 +1251,21 @@ validate (options const& ops, unsigned short pass) { bool valid (true); + + // Validate options. + // + if (ops.generate_schema_only () && + (ops.schema_format ().size () != 1 || + *ops.schema_format ().begin () != schema_format::sql)) + { + cerr << "error: --generate-schema-only is only valid when generating " << + "schema as a standalone SQL file" << endl; + valid = false; + } + + if (!valid) + throw failed (); + auto_ptr<context> ctx (create_context (cerr, u, ops, f, 0)); if (pass == 1) |