if (args != null && args.length > 0) {
String action = args[0];
String alias = null;
String masterKey = null;
CredentialProvider credentialProvider = null;
Configuration configuration = new Configuration();
if (args.length > 1 && !args[1].isEmpty()) {
alias = args[1];
} else {
LOG.error("No valid arguments provided.");
System.exit(1);
}
// None - To avoid incorrectly assuming redirection as argument
if (args.length > 3 && !args[3].isEmpty() && !args[3].equalsIgnoreCase
("None")) {
masterKey = args[3];
LOG.debug("Master key provided as an argument.");
}
try {
credentialProvider = new CredentialProvider(masterKey,
configuration.getMasterKeyLocation(),
configuration.isMasterKeyPersisted());
} catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
LOG.info("action => " + action + ", alias => " + alias);