summaryrefslogtreecommitdiff
path: root/server/src/pracrod.cc
diff options
context:
space:
mode:
authorbertho <bertho>2009-02-04 11:37:49 +0000
committerbertho <bertho>2009-02-04 11:37:49 +0000
commit6ad7301c3a364a34747ecc631a8b239570c303fa (patch)
tree3627d97211ae8f7a53256b9447a9ca16f91fba5d /server/src/pracrod.cc
parent1bce9e4ebb9521c26fdbc586d4eadd6f2a52b618 (diff)
- Add missing include files
- Add config option for xml macros and templates basedir
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 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);