summaryrefslogtreecommitdiff
path: root/server/src/pracrod.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/pracrod.cc')
-rw-r--r--server/src/pracrod.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc
index a929f63..75f58a6 100644
--- a/server/src/pracrod.cc
+++ b/server/src/pracrod.cc
@@ -88,6 +88,7 @@ static const char usage_str[] =
" -v, --version Print version information and exit.\n"
" -h, --help Print this message and exit.\n"
" -D, --debug ddd Enable debug messages on 'ddd'; see documentation for details\n"
+" -d --database db Use db as the database backend. Can be one of pgsql or testdb (default pgsql).\n"
;
ConfigurationParser *configparser = NULL;
@@ -145,6 +146,7 @@ int main(int argc, char *argv[])
bool foreground = false;
char *xml_basedir = NULL;
char *debugstr = NULL;
+ std::string database;
pracro_debug_init();
@@ -160,15 +162,20 @@ int main(int argc, char *argv[])
{"version", no_argument, 0, 'v'},
{"xml-basedir", required_argument, 0, 'x'},
{"debug", required_argument, 0, 'D'},
+ {"database", required_argument, 0, 'd'},
{0, 0, 0, 0}
};
- c = getopt_long (argc, argv, "D:hvfc:u:g:x:", long_options, &option_index);
+ c = getopt_long (argc, argv, "D:hvfc:u:g:x:d:", long_options, &option_index);
if (c == -1)
break;
switch(c) {
+ case 'd':
+ database = optarg;
+ break;
+
case 'c':
configfile = strdup(optarg);
break;
@@ -217,6 +224,10 @@ int main(int argc, char *argv[])
if(configfile) configparser = new ConfigurationParser(configfile);
else configparser = new ConfigurationParser(ETC"/pracrod.conf");
+ if(database != "") {
+ Conf::database_backend = database;
+ }
+
if(!user) {
user = strdup(Conf::server_user.c_str());
}