Skip to content

Commit

Permalink
small fix for the Command completion
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 16, 2013
1 parent 3e935da commit c6a6633
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ private Iterable<ShellCommand> findMatchingCommands(CompleteOperation completeOp
Iterable<ShellCommand> commands = shell.getEnabledShellCommands();

String[] tokens = completeOperation.getBuffer().split(String.valueOf(completeOperation.getSeparator()));
String token = (tokens.length == 1) ? tokens[0] : null;
for (ShellCommand cmd : commands)
if (tokens.length <= 1)
{
if (token == null || cmd.getMetadata().getName().startsWith(token))
result.add(cmd);
String token = (tokens.length == 1) ? tokens[0] : null;
for (ShellCommand cmd : commands)
{
if (token == null || cmd.getMetadata().getName().startsWith(token))
result.add(cmd);
}
}
return result;
}
Expand Down

0 comments on commit c6a6633

Please sign in to comment.