String hostname = args[0];
String newsgroup = args[1];
NNTPClient client = new NNTPClient();
client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true));
client.connect(hostname);
if (args.length == 4) { // Optional auth
String user = args[2];
String password = args[3];
if(!client.authenticate(user, password)) {