|
@@ -619,6 +619,11 @@ let check_auxiliary_output com xml_out json_out =
|
|
|
Genjson.generate com.types file
|
|
|
end
|
|
|
|
|
|
+let parse_host_port hp =
|
|
|
+ let host, port = (try ExtString.String.split hp ":" with _ -> "127.0.0.1", hp) in
|
|
|
+ let port = try int_of_string port with _ -> raise (Arg.Bad "Invalid port") in
|
|
|
+ host, port
|
|
|
+
|
|
|
let rec process_params create pl =
|
|
|
let each_params = ref [] in
|
|
|
let rec loop acc = function
|
|
@@ -915,20 +920,24 @@ try
|
|
|
force_typing := true;
|
|
|
config_macros := e :: !config_macros
|
|
|
),"<macro>","call the given macro before typing anything else");
|
|
|
- ("Compilation Server",["--wait"],[], Arg.String (fun hp ->
|
|
|
+ ("Compilation Server",["--server-listen"],["--wait"], Arg.String (fun hp ->
|
|
|
let accept = match hp with
|
|
|
| "stdio" ->
|
|
|
Server.init_wait_stdio()
|
|
|
| _ ->
|
|
|
- let host, port = (try ExtString.String.split hp ":" with _ -> "127.0.0.1", hp) in
|
|
|
- let port = try int_of_string port with _ -> raise (Arg.Bad "Invalid port") in
|
|
|
+ let host, port = parse_host_port hp in
|
|
|
init_wait_socket host port
|
|
|
in
|
|
|
wait_loop process_params com.verbose accept
|
|
|
- ),"[[host:]port]|stdio]","wait on the given port (or use standard i/o) for commands to run)");
|
|
|
+ ),"[[host:]port]|stdio]","wait on the given port (or use standard i/o) for commands to run");
|
|
|
+ ("Compilation Server",["--server-connect"],[], Arg.String (fun hp ->
|
|
|
+ let host, port = parse_host_port hp in
|
|
|
+ let accept = Server.init_wait_connect host port in
|
|
|
+ wait_loop process_params com.verbose accept
|
|
|
+ ),"[host:]port]","connect to the given port and wait for commands to run");
|
|
|
("Compilation Server",["--connect"],[],Arg.String (fun _ ->
|
|
|
assert false
|
|
|
- ),"<[host:]port>","connect on the given port and run commands there)");
|
|
|
+ ),"<[host:]port>","connect on the given port and run commands there");
|
|
|
("Compilation",["-C";"--cwd"],[], Arg.String (fun dir ->
|
|
|
assert false
|
|
|
),"<dir>","set current working directory");
|