Newer
Older
//
// sld.cc for sld in /home/seblu
//
// Made by Seblu
// Login <seblu@epita.fr>
//
// Started on Fri Jun 1 02:09:43 2007 Seblu
// Last update Fri Jun 1 02:10:49 2007 Seblu
//
SLDaemon daemon;
SLDaemon::options *lineopt;
SLDaemon::options *fileopt = NULL;
try {
//parse arg line options
lineopt = daemon.getoptions(argc, argv);
assert(lineopt);
if (lineopt->conffile != "") {
//parse conf file options
fileopt = daemon.getoptions(lineopt->conffile);
}
}
catch (const Error &e) {
e.print();
return e.code();
}
try {
//apply config file option
if (fileopt)
daemon.applyoptions(fileopt);
//execute receive command
daemon.run();
}
catch (const Error &e) {
std::cerr <<"sld: error: " << e.message() << std::endl;
return e.code();
}
return EXIT_UNKNOWN;