public static void main(String[] args) {
Opts opts = new Opts();
opts.parseArgs(CreateToken.class.getName(), args);
Password pass = opts.password;
if (pass == null && opts.securePassword != null) {
pass = opts.securePassword;
}
try {
String principal = opts.principal;
if (principal == null) {
principal = getConsoleReader().readLine("Username (aka principal): ");
}
AuthenticationToken token = Class.forName(opts.tokenClassName).asSubclass(AuthenticationToken.class).newInstance();
Properties props = new Properties();
for (TokenProperty tp : token.getProperties()) {
String input;
if (pass != null && tp.getKey().equals("password")) {
input = pass.toString();
} else {
if (tp.getMask()) {
input = getConsoleReader().readLine(tp.getDescription() + ": ", '*');
} else {
input = getConsoleReader().readLine(tp.getDescription() + ": ");