Changeset 15086
- Timestamp:
- 03/18/13 14:35:28 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/dimctrl.cc
r15021 r15086 11 11 int RunShell(Configuration &conf) 12 12 { 13 StateMachineDimControl::fIsServer = conf.Get <bool>("server");13 StateMachineDimControl::fIsServer = conf.GetName()=="dimserver"; 14 14 return Main::execute<T, StateMachineDimControl>(conf); 15 15 } … … 17 17 void SetupConfiguration(Configuration &conf) 18 18 { 19 po::options_description control(" Dim control options");19 po::options_description control("Options ("+conf.GetName()+")"); 20 20 control.add_options() 21 ("server", po_bool(false), "Start dimctrl as a dim server (console mode switched off)") 22 ("force-console",po_switch(), "Forces console mode in server-mode.") 23 ("debug", po_bool(false), "Print the labels for debugging purpose") 24 ("start", var<string>(), "Start a java script with the given name on the dimctrl-server") 25 ("batch", var<string>(), "Start a batch script with the given name at the given label (script.dim[:N]) on the dimctrl-server") 26 ("stop", po_switch(), "Stop a currently running script on the dimctrl-server") 27 ("restart", var<string>(), "Send 'EXIT 126' to the given server") 28 ("msg", var<string>(), "Send a message to the chat server.") 29 ("user,u", var<string>(""), "A user name - just for logging purposes (default is ${USER})") 30 ("JavaScript.*", var<string>(""), "Additional arguments which are provided to JavaScripts started in a dimctrl server via the START command") 21 ("force-console", po_switch(), "Forces console mode in server-mode.") 22 ("debug", po_bool(false), "Print the labels for debugging purpose") 23 ("user,u", var<string>(""), "A user name - just for logging purposes (default is ${USER})") 24 ("JavaScript.*", var<string>(""), "Additional arguments which are provided to JavaScripts started in a dimctrl server via the START command") 31 25 ; 26 27 if (conf.GetName()!="dimserver") 28 { 29 control.add_options() 30 ("start", var<string>(), "Start a java script with the given name on the dimctrl-server") 31 ("batch", var<string>(), "Start a batch script with the given name at the given label (script.dim[:N]) on the dimctrl-server") 32 ("stop", po_switch(), "Stop a currently running script on the dimctrl-server") 33 ("restart", var<string>(), "Send 'EXIT 126' to the given server") 34 ("msg", var<string>(), "Send a message to the chat server.") 35 ; 36 } 32 37 33 38 conf.AddEnv("user", "USER"); … … 51 56 "\n" 52 57 "The program can be started as a dim server, so that it is visible " 53 "in the d m network to other clients. If started as a client, it can"54 " only interact passively with the dim network. The usual case should"55 " be to have one server running and control it from a dimctrl started"56 "a s client.\n"58 "in the dim network to other clients. If started as a client (dimctrl), " 59 "it can only interact passively with the dim network. The usual case " 60 "should be to have one server running (dimserver) and control it from " 61 "a dimctrl started.\n" 57 62 "\n" 58 "Usage: dimctrl [--server|-c type] [OPTIONS]\n" 59 " or: dimctrl [OPTIONS]\n"; 63 "Usage: dimctrl [-c type] [OPTIONS]\n" 64 " or: dimctrl [OPTIONS]\n" 65 " or: dimserver [OPTIONS]\n"; 60 66 cout << endl; 61 67 } … … 96 102 throw runtime_error("--force-console must be used with --console/-c"); 97 103 98 if (conf.Get <bool>("server")&& !conf.Get<bool>("force-console"))104 if (conf.GetName()=="dimserver" && !conf.Get<bool>("force-console")) 99 105 conf.Remove("console"); 100 106
Note:
See TracChangeset
for help on using the changeset viewer.