diff options
Diffstat (limited to 'server/src/pracrod.cc')
-rw-r--r-- | server/src/pracrod.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc index 634ae67..a1c8ba1 100644 --- a/server/src/pracrod.cc +++ b/server/src/pracrod.cc @@ -62,6 +62,8 @@ #include "tcpsocket.h" +#include "debug.h" + static const char version_str[] = "Pracro server v" VERSION "\n" ; @@ -85,6 +87,7 @@ static const char usage_str[] = " -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" ; ConfigurationParser *configparser = NULL; @@ -141,6 +144,9 @@ int main(int argc, char *argv[]) char *group = NULL; bool foreground = false; char *xml_basedir = NULL; + char *debugstr = NULL; + + pracro_debug_init(); int option_index = 0; while(1) { @@ -153,10 +159,11 @@ int main(int argc, char *argv[]) {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, {"xml-basedir", required_argument, 0, 'x'}, + {"debug", required_argument, 0, 'D'}, {0, 0, 0, 0} }; - c = getopt_long (argc, argv, "hvfc:u:g:x:", long_options, &option_index); + c = getopt_long (argc, argv, "D:hvfc:u:g:x:", long_options, &option_index); if (c == -1) break; @@ -182,6 +189,10 @@ int main(int argc, char *argv[]) xml_basedir = strdup(optarg); break; + case 'D': + debugstr = strdup(optarg); + break; + case '?': case 'h': printf(version_str); @@ -198,6 +209,10 @@ int main(int argc, char *argv[]) } } + if(debugstr) { + pracro_debug_parse(debugstr); + } + // Load config if(configfile) configparser = new ConfigurationParser(configfile); else configparser = new ConfigurationParser(ETC"/pracrod.conf"); |