int port = ((Integer) parser.getOptionValue(optPort, Integer.valueOf(22))).intValue();
String username = (String) parser.getOptionValue(optUsername);
String password = (String) parser.getOptionValue(optPassword, "");
setPromptSize(((Integer) parser.getOptionValue(optPromptSize, Integer.valueOf(10))).intValue());
StreamConnection streamConnection = new DefaultStreamConnection();
streamConnection.addStreamListener(this);
streamConnection.connect(host, port, username, password);
startRecording(parser.getRemainingArgs()[0], host, port, username, password);
ConsoleReader reader = new ConsoleReader();
Thread t = new Thread(reader);
t.start();
streamConnection.waitFor("asfdasfasfdSomeStringThatDoesntExistasdfasdf");
endRecording();
System.exit(0);
}
return parser.getRemainingArgs();