11 po::options_description config(
"Configuration");
13 (
"dns", var<string>(
"localhost"),
"Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
14 (
"schedule-database-name", var<string>(),
"Database name for scheduling")
17 po::positional_options_description p;
18 p.add(
"schedule-database-name", 1);
20 conf.
AddEnv(
"dns",
"DIM_DNS_NODE");
28 "The triggerschedule triggers the scheduler.\n" 30 "The default is that the program is started without user intercation. " 31 "All actions are supposed to arrive as DimCommands. Using the -c " 32 "option, a local shell can be initialized. With h or help a short " 33 "help message about the usuage can be brought to the screen.\n" 35 "Usage: triggerschedule [-c type] [OPTIONS] <schedule-database-name>\n" 36 " or: triggerschedule [OPTIONS] <schedule-database-name>\n";
44 "The method sendCommand(...) will wait for the command to " 45 "be actualy sent to the server and return a completion code " 47 " 0 - if it was successfully sent.\n" 48 " 1 - if it couldn't be delivered.\n " 54 int main(
int argc,
const char* argv[])
63 const string dbname = conf.
Get<
string>(
"schedule-database-name");
69 cerr <<
"Sending failed!" << endl;
71 cout <<
"Command issued successfully." << endl;
static int sendCommand(const char *name, int data)
void SetPrintUsage(const std::function< void(void)> &func)
T Get(const std::string &var)
void AddEnv(const std::string &conf, const std::string &env)
void SetArgumentPositions(const po::positional_options_description &desc)
void Setup(const std::string &dns="", const std::string &host="")
void AddOptions(const po::options_description &opt, bool visible=true)
int main(int argc, const char *argv[])
Commandline parsing, resource file parsing and database access.
void SetupConfiguration(Configuration &conf)
bool DoParse(int argc, const char **argv, const std::function< void()> &func=std::function< void()>())