From 6ad7301c3a364a34747ecc631a8b239570c303fa Mon Sep 17 00:00:00 2001 From: bertho Date: Wed, 4 Feb 2009 11:37:49 +0000 Subject: - Add missing include files - Add config option for xml macros and templates basedir --- server/src/pracrod.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'server/src/pracrod.cc') diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc index 6ca21db..634ae67 100644 --- a/server/src/pracrod.cc +++ b/server/src/pracrod.cc @@ -82,6 +82,7 @@ static const char usage_str[] = " -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" ; @@ -139,6 +140,7 @@ int main(int argc, char *argv[]) char *user = NULL; char *group = NULL; bool foreground = false; + char *xml_basedir = NULL; int option_index = 0; while(1) { @@ -150,10 +152,11 @@ int main(int argc, char *argv[]) {"group", required_argument, 0, 'g'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, + {"xml-basedir", required_argument, 0, 'x'}, {0, 0, 0, 0} }; - c = getopt_long (argc, argv, "hvfc:u:g:", long_options, &option_index); + c = getopt_long (argc, argv, "hvfc:u:g:x:", long_options, &option_index); if (c == -1) break; @@ -175,6 +178,10 @@ int main(int argc, char *argv[]) group = strdup(optarg); break; + case 'x': + xml_basedir = strdup(optarg); + break; + case '?': case 'h': printf(version_str); @@ -204,6 +211,10 @@ int main(int argc, char *argv[]) group = strdup(Conf::server_group.c_str()); } + if(xml_basedir) { + Conf::xml_basedir = xml_basedir; + } + signal(SIGHUP, reload); signal(SIGCLD, childwait); if(foreground) signal (SIGINT, ctrl_c); -- cgit v1.2.3