From 1ab83e42e24dcc8f6e7f0abb6d76bb5c06a8f189 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 31 Jan 2016 12:48:40 +0200 Subject: Add support for man page generation/install/dist --- migrate/.gitignore | 4 +-- migrate/buildfile | 8 ++--- migrate/migrate.cli | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++ migrate/migrate.cxx | 2 +- migrate/options.cli | 90 ----------------------------------------------------- 5 files changed, 97 insertions(+), 97 deletions(-) create mode 100644 migrate/migrate.cli delete mode 100644 migrate/options.cli (limited to 'migrate') diff --git a/migrate/.gitignore b/migrate/.gitignore index 580958d..7323078 100644 --- a/migrate/.gitignore +++ b/migrate/.gitignore @@ -1,3 +1,3 @@ -options -options.?xx +*-options +*-options.?xx brep-migrate diff --git a/migrate/buildfile b/migrate/buildfile index c42de5a..cd0b9c8 100644 --- a/migrate/buildfile +++ b/migrate/buildfile @@ -7,12 +7,12 @@ import libs += libodb%lib{odb} include ../brep/ -exe{brep-migrate}: \ -{ cxx}{ migrate } \ -{hxx ixx cxx}{ options } \ +exe{brep-migrate}: \ +{ cxx}{ migrate } \ +{hxx ixx cxx}{ migrate-options } \ ../brep/lib{brep} $libs cli.options += -I $src_root --include-with-brackets --include-prefix migrate \ --guard-prefix MIGRATE -{hxx ixx cxx}{options}: cli{options} +{hxx ixx cxx}{migrate-options}: cli{migrate} diff --git a/migrate/migrate.cli b/migrate/migrate.cli new file mode 100644 index 0000000..35d082f --- /dev/null +++ b/migrate/migrate.cli @@ -0,0 +1,90 @@ +// file : migrate/migrate.cli +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +include ; +include ; // uint16_t + +"\section=1" +"\name=brep-migrate" +"\summary=create/drop/migrate build2 repository database" + +{ + "", + + "\h|SYNOPSIS| + + \cb{brep-migrate --help}\n + \cb{brep-migrate --version}\n + \c{\b{brep-migrate} []} + + \h|DESCRIPTION| + + In its default mode \cb{brep-migrate} creates the database schema if it + doesn't already exist. Otherwise, it migrates the existing schema and data + to the current version, if needed. + + If the \cb{--recreate} option is specified, then \cb{brep-migrate} instead + recreates the database schema. That is, it drops all the existing tables + (and their data) and then creates them from scratch. + + If the \cb{--drop} option is specified, then \cb{brep-migrate} drops all the + existing tables (and their data). + + The \cb{--recreate} and \cb{--drop} options are mutually exclusive. When + specified, they will cause \cb{brep-migrate} to fail if the database schema + requires migration. In this case you can either migrate the database first + or drop the entire database using, for example, \cb{psql(1)}." +} + +class options +{ + "\h|OPTIONS|" + + bool --recreate + { + "Recreate the database schema (all the existing data will be lost)." + } + + bool --drop + { + "Drop the database schema (all the existing data will be lost)." + } + + std::string --db-user|-u + { + "", + "Database user name. If not specified, then operating system (login) + name is used." + } + + std::string --db-password + { + "", + "Database password. If not specified, then login without password is + expected to work." + } + + std::string --db-name|-n = "brep" + { + "", + "Database name. If not specified, then '\cb{brep}' is used by default." + } + + std::string --db-host|-h + { + "", + "Database host name, address, or socket. If not specified, then connect + to \cb{localhost} using the operating system-default mechanism + (Unix-domain socket, etc)." + } + + std::uint16_t --db-port|-p = 0 + { + "", + "Database port number. If not specified, the default port is used." + } + + bool --help {"Print usage information and exit."} + bool --version {"Print version and exit."} +}; diff --git a/migrate/migrate.cxx b/migrate/migrate.cxx index aa71b67..405770f 100644 --- a/migrate/migrate.cxx +++ b/migrate/migrate.cxx @@ -23,7 +23,7 @@ #include -#include +#include using namespace std; using namespace odb::core; diff --git a/migrate/options.cli b/migrate/options.cli deleted file mode 100644 index e36155c..0000000 --- a/migrate/options.cli +++ /dev/null @@ -1,90 +0,0 @@ -// file : migrate/options.cli -// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -include ; -include ; // uint16_t - -"\section=1" -"\name=brep-migrate" -"\summary=create/drop/migrate brep database" - -{ - "", - - "\h|SYNOPSIS| - - \cb{brep-migrate --help}\n - \cb{brep-migrate --version}\n - \c{\b{brep-migrate} []} - - \h|DESCRIPTION| - - In its default mode \cb{brep-migrate} creates the database schema if it - doesn't already exist. Otherwise, it migrates the existing schema and data - to the current version, if needed. - - If the \cb{--recreate} option is specified, then \cb{brep-migrate} instead - recreates the database schema. That is, it drops all the existing tables - (and their data) and then creates them from scratch. - - If the \cb{--drop} option is specified, then \cb{brep-migrate} drops all the - existing tables (and their data). - - The \cb{--recreate} and \cb{--drop} options are mutually exclusive. When - specified, they will cause \cb{brep-migrate} to fail if the database schema - requires migration. In this case you can either migrate the database first - or drop the entire database using, for example, \cb{psql(1)}." -} - -class options -{ - "\h|OPTIONS|" - - bool --recreate - { - "Recreate the database schema (all the existing data will be lost)." - } - - bool --drop - { - "Drop the database schema (all the existing data will be lost)." - } - - std::string --db-user|-u - { - "", - "Database user name. If not specified, then operating system (login) - name is used." - } - - std::string --db-password - { - "", - "Database password. If not specified, then login without password is - expected to work." - } - - std::string --db-name|-n = "brep" - { - "", - "Database name. If not specified, then '\cb{brep}' is used by default." - } - - std::string --db-host|-h - { - "", - "Database host name, address, or socket. If not specified, then connect - to \cb{localhost} using the operating system-default mechanism - (Unix-domain socket, etc)." - } - - std::uint16_t --db-port|-p = 0 - { - "", - "Database port number. If not specified, the default port is used." - } - - bool --help {"Print usage information and exit."} - bool --version {"Print version and exit."} -}; -- cgit v1.1