Skip to content

Commit

Permalink
correctly report no aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
michpetrov committed Apr 24, 2017
1 parent bfc98cc commit 050fad3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,15 @@ public void execute(String[] args) throws Exception {
}
} else if (cmdLine.hasOption(ALIASES_PARAM)) {
Set<String> aliases = credentialStore.getAliases();
StringBuilder list = new StringBuilder();
for (String alias: aliases) {
list.append(alias).append(" ");
if (aliases.size() != 0) {
StringBuilder list = new StringBuilder();
for (String alias: aliases) {
list.append(alias).append(" ");
}
System.out.println(ElytronToolMessages.msg.aliases(list.toString()));
} else {
System.out.println(ElytronToolMessages.msg.noAliases());
}
System.out.println(ElytronToolMessages.msg.aliases(list.toString()));
setStatus(ElytronTool.ElytronToolExitStatus_OK);
} else {
setStatus(ACTION_NOT_DEFINED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ public interface ElytronToolMessages extends BasicLogger {
@Message(id = NONE, value = "Credential store contains following aliases: %s")
String aliases(String aliases);

@Message(id = NONE, value = "Credential store contains no aliases")
String noAliases();

@Message(id = NONE, value = "Action to perform on the credential store is not defined")
Exception actionToPerformNotDefined();

Expand Down

0 comments on commit 050fad3

Please sign in to comment.