Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
int c;
while ((c = g.getopt()) != -1) {
switch (c) {
case 'c':
Connection connection = ConnectionFactory.getConnection(g.getOptarg());
String password = null;
if (connection.needsCredentials()) {
java.io.Console sysConsole = System.console();
if (sysConsole != null) {
password = new String(sysConsole.readPassword("Password: "));
} else {
exitWithError("Cannot read password non-interactively");
}
}
connection.connect(context, password);
context.setConnection(connection);
break;
case 'f':
inputFile = g.getOptarg();
if ("-".equals(inputFile) || new File(inputFile).isFile()) {