--- smsdaemon/common.cpp 2008/12/07 16:31:40 145 +++ smsdaemon/common.cpp 2008/12/07 20:06:12 146 @@ -13,6 +13,7 @@ #include "TaskManager.h" #include "PluginManager.h" +#include "ConfigFile.h" using namespace std; const char* Months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov","Dec"}; @@ -29,6 +30,8 @@ { _pluginManager = new PluginManager(); _taskManager = new TaskManager(); + configFilePath = "/etc/smsdaemon.conf"; + _configFile = new ConfigFile(); } @@ -51,6 +54,11 @@ return _taskManager; } +ConfigFile* Common::GetConfigfile() +{ + return _configFile; +} + void Common::logMessage(string msg) { time_t t = time(0); @@ -89,10 +97,12 @@ cout << SVNVERSION << endl << endl; cout << "Usage --daemon|--debug [arguments]" << endl; cout << "Commandline arguments :" << endl; - cout << " --daemon : Run in daemon (background) mode" << endl; - cout << " --debug : Run as normal (frontground) process," << endl; - cout << " with all messages written to std out" << endl; - cout << " --help : Show this help screen" << endl; + cout << " --daemon : Run in daemon (background) mode" << endl; + cout << " --debug : Run as normal (frontground) process," << endl; + cout << " with all messages written to std out" << endl; + cout << " --config : Specify which config file to use " << endl; + cout << " default" << configFilePath << endl; + cout << " --help : Show this help screen" << endl; exit(0); } @@ -116,6 +126,9 @@ isDaemon = false; isDebug = true; } + else if (current == "--config") + { + } else if (current == "-h" || current == "--help") { printUsage();