X-Git-Url: http://nitlanguage.org diff --git a/src/nitdbg_client.nit b/src/nitdbg_client.nit index 0531b05..4b01ecd 100644 --- a/src/nitdbg_client.nit +++ b/src/nitdbg_client.nit @@ -65,7 +65,6 @@ class DebugClient print "[HOST ADDRESS] : "+debugger_connection.address print "[HOST] : "+debugger_connection.host.as(not null) print "[PORT] : "+debugger_connection.port.to_s - print "Connecting ... "+debugger_connection.connect.to_s end init with_port (host: String, port: Int) @@ -90,7 +89,7 @@ class DebugClient fun read_command: String do - var buff = new Buffer + var buff = new FlatBuffer while debugger_connection.ready_to_read(40) do buff.append(debugger_connection.read) return buff.to_s end @@ -104,15 +103,12 @@ end # Create a tool context to handle options and paths var toolcontext = new ToolContext -toolcontext.process_options +toolcontext.tooldescription = "Usage: nitdbg_client [OPTION]...\nConnects to a nitdbg_server and controls it." +toolcontext.accept_no_arguments = true +toolcontext.process_options(args) var debug: DebugClient -if toolcontext.opt_help.value then - toolcontext.option_context.usage - return -end - # If the port value is not an Int between 0 and 65535 (Mandatory according to the norm) # Print the usage if toolcontext.opt_debug_port.value < 0 or toolcontext.opt_debug_port.value > 65535 then @@ -133,6 +129,10 @@ else debug = new DebugClient("127.0.0.1", toolcontext.opt_debug_port.value) end +var res = debug.debugger_connection.connect +print "Connecting ... " + res.to_s +if not res then exit 1 + var recv_cmd: String var written_cmd: String