summaryrefslogtreecommitdiff
path: root/odb/odb.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-06-11 11:36:07 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-06-11 15:57:30 +0300
commit1ca3ce471906f08d23f9163cdb8da884175ed331 (patch)
treea273bc264e6ee982b6d8d6cb31b85568d462b348 /odb/odb.cxx
parentad26234a4313096a018bdbe162cff4d6440ba484 (diff)
Add metadata
Diffstat (limited to 'odb/odb.cxx')
-rw-r--r--odb/odb.cxx36
1 files changed, 29 insertions, 7 deletions
diff --git a/odb/odb.cxx b/odb/odb.cxx
index 5381668..225cc21 100644
--- a/odb/odb.cxx
+++ b/odb/odb.cxx
@@ -592,20 +592,40 @@ main (int argc, char* argv[])
cli::argv_file_scanner scan (ac, &av[0], oi, 3);
options ops (scan);
+ // Handle --build2-metadata (see also buildfile).
+ //
+ if (ops.build2_metadata_specified ())
+ {
+ ostream& o (cout);
+
+ // Note that the export.metadata variable should be the first non-
+ // blank/comment line.
+ //
+ o << "# build2 buildfile odb" << endl
+ << "export.metadata = 1 odb" << endl
+ << "odb.name = [string] odb" << endl
+ << "odb.version = [string] '" << ODB_COMPILER_VERSION_STR << '\'' << endl
+ << "odb.checksum = [string] '" << ODB_COMPILER_VERSION_STR << '\'' << endl;
+
+ return 0;
+ }
+
// Handle --version.
//
if (ops.version ())
{
- cout << "ODB object-relational mapping (ORM) compiler for C++ "
+ ostream& o (cout);
+
+ o << "ODB object-relational mapping (ORM) compiler for C++ "
ODB_COMPILER_VERSION_STR << endl;
#ifdef ODB_BUILD2
- cout << "Copyright (c) " << ODB_COPYRIGHT << "." << endl;
+ o << "Copyright (c) " << ODB_COPYRIGHT << "." << endl;
#endif
- cout << "This is free software; see the source for copying "
- << "conditions. There is NO\nwarranty; not even for "
- << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." << endl;
+ o << "This is free software; see the source for copying conditions. "
+ << "There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS "
+ << "FOR A PARTICULAR PURPOSE." << endl;
return 0;
}
@@ -614,8 +634,10 @@ main (int argc, char* argv[])
//
if (ops.help ())
{
- cout << "Usage: " << argv[0] << " [options] file [file ...]" << endl
- << "Options:" << endl;
+ ostream& o (cout);
+
+ o << "Usage: " << argv[0] << " [options] file [file ...]" << endl
+ << "Options:" << endl;
options::print_usage (cout);
return 0;