}
}
public static void main(String[] args) throws IOException, DeploymentException, InterruptedException {
final ClientManager clientManager = new ClientManager();
try {
final ConsoleReader console = new ConsoleReader(
NAME,
new FileInputStream(FileDescriptor.in), System.out, null);
console.addCompleter(new StringsCompleter("open", "close", "send", "ping", "exit", "quit", "help"));
console.setPrompt(getPrompt());
if (args.length > 0) {
int i = 0;
String arg;
while (i < args.length && args[i].startsWith("--")) {
arg = args[i++];
if (arg.equals("--proxy")) {
if (i < args.length) {
final String proxyUrl = args[i++];
clientManager.getProperties().put(ClientManager.PROXY_URI, proxyUrl);
} else {
ClientCli.print(console, null, String.format("--proxy requires an argument (url)"), false);
}
}