23 int main(
int numc,
char* args[])
25 const char* configuration =
nullptr;
26 const char* workdir =
nullptr;
27 unsigned configid = 0;
29 if(numc > 1) configuration = args[1];
37 const char* arg = args[cnt++];
39 if (strcmp(arg,
"-id")==0) {
41 configid = std::stoul(args[cnt++]);
43 if (strcmp(arg,
"-workdir")==0) {
45 workdir = args[cnt++];
47 if (strcmp(arg,
"-number")==0) {
50 std::cout << res << std::endl;
53 if (strcmp(arg,
"-mode") == 0) {
54 const char* kind = (cnt < numc) ? args[cnt++] :
"start";
55 std::string res = cfg.
SshArgs(configid, kind, configuration, workdir);
56 if (res.length()==0)
return 7;
57 std::cout << res << std::endl;
60 if (strstr(arg,
"-nodename")==arg) {
61 std::string name = cfg.
NodeName(configid);
62 if (name.length() == 0)
return 5;
63 std::cout << name << std::endl;
66 if (strstr(arg,
"-contextname")==arg) {
68 if (name.length() == 0)
return 5;
69 std::cout << name << std::endl;
Base class to read configuration from xml file.
std::string SshArgs(unsigned id=0, const char *skind="run", const char *topcfgfile=0, const char *topworkdir=0)
method used by run.sh script to produce command line
std::string NodeName(unsigned id)
returns nodename of specified context
std::string ContextName(unsigned id)
returns name of specified context
unsigned NumNodes()
returns number of nodes in xml file
int main(int numc, char *args[])