diff --git a/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java b/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java index 685f63d0986..ef1b4070d24 100644 --- a/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java +++ b/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java @@ -333,11 +333,7 @@ public class ESUsersTool extends CliTool { private static final CliToolConfig.Cmd CMD = cmd(NAME, Useradd.class).build(); public static Command parse(Terminal terminal, CommandLine cli) { - if (cli.getArgs().length == 0) { - return exitCmd(ExitStatus.USAGE, terminal, "username is missing"); - } - - String username = cli.getArgs()[0]; + String username = (cli.getArgs().length > 0) ? cli.getArgs()[0] : null; return new ListUsersAndRoles(terminal, username); } diff --git a/src/main/resources/org/elasticsearch/shield/authc/esusers/tool/esusers.help b/src/main/resources/org/elasticsearch/shield/authc/esusers/tool/esusers.help index f6282d8f056..7e5a59b26a4 100644 --- a/src/main/resources/org/elasticsearch/shield/authc/esusers/tool/esusers.help +++ b/src/main/resources/org/elasticsearch/shield/authc/esusers/tool/esusers.help @@ -21,6 +21,10 @@ COMMANDS userdel Removes an existing native user from the system + roles Manage roles of a single user + + list List users and roles + NOTES [*] For usage help on specific commands please type "security -h" \ No newline at end of file