diff options
author | deva <deva> | 2010-07-07 11:55:58 +0000 |
---|---|---|
committer | deva <deva> | 2010-07-07 11:55:58 +0000 |
commit | 78cab4908b1784c67bee0064502854b1a984342f (patch) | |
tree | 7b8887fde38039fa4a750f124be50eafbf48edf2 /server | |
parent | 1c935722320e3b73f1005509849b5a2f22c72577 (diff) |
Make session-path set-able via cli.
Diffstat (limited to 'server')
-rw-r--r-- | server/src/pracrod.cc | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc index 1488909..73fe259 100644 --- a/server/src/pracrod.cc +++ b/server/src/pracrod.cc @@ -80,17 +80,18 @@ static const char copyright_str[] = static const char usage_str[] = "Usage: %s [options]\n" "Options:\n" -" -c, --config file Read configfile from 'file'\n" -" -f, --foreground Run in foreground mode (non-background mode)\n" -" -u, --user user Run as 'user' (overrides the configfile)\n" -" -g, --group group Run as 'group' (overrides the configfile)\n" -" -x, --xml-basedir d Use 'd' as basedir for finding template- and macro-files (default "XML").\n" -" -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" -" -s, --ssl keyfile Enable ssl encryption with the key stored in keyfile.\n" -" -L, --logfile file Write output to file, instead of stderr.\n" +" -c, --config file Read configfile from 'file'\n" +" -f, --foreground Run in foreground mode (non-background mode)\n" +" -u, --user user Run as 'user' (overrides the configfile)\n" +" -g, --group group Run as 'group' (overrides the configfile)\n" +" -x, --xml-basedir d Use 'd' as basedir for finding template- and macro-files (default "XML").\n" +" -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" +" -s, --ssl keyfile Enable ssl encryption with the key stored in keyfile.\n" +" -L, --logfile file Write output to file, instead of stderr.\n" +" -S, --session-path dir Use dir as the path for active session storage.\n" ; ConfigurationParser *configparser = NULL; @@ -185,6 +186,7 @@ int main(int argc, char *argv[]) char *debugstr = NULL; std::string database; std::string pidfile; + std::string sessionpath; int option_index = 0; while(1) { @@ -202,10 +204,11 @@ int main(int argc, char *argv[]) {"ssl", required_argument, 0, 's'}, {"pidfile", required_argument, 0, 'P'}, {"logfile", required_argument, 0, 'L'}, + {"session-path", required_argument, 0, 'S'}, {0, 0, 0, 0} }; - c = getopt_long (argc, argv, "D:hvfc:u:g:x:d:s:L:P:", + c = getopt_long (argc, argv, "D:hvfc:u:g:x:d:s:L:P:S:", long_options, &option_index); if (c == -1) @@ -244,6 +247,10 @@ int main(int argc, char *argv[]) logfile = optarg; break; + case 'S': + sessionpath = optarg; + break; + case 'D': debugstr = strdup(optarg); break; @@ -292,6 +299,10 @@ int main(int argc, char *argv[]) if(configfile) configparser = new ConfigurationParser(configfile); else configparser = new ConfigurationParser(ETC"/pracrod.conf"); + if(sessionpath != "") { + Conf::session_path = sessionpath; + } + if(database != "") { Conf::database_backend = database; } |