}
}
if (!subShell.equals(Session.SCOPE_GLOBAL)) {
completers.add(new StringsCompleter(new String[] { "exit" }));
}
int res = new AggregateCompleter(completers).complete(session, commandLine, candidates);
Collections.sort(candidates);
return res;
}
// FIRST mode
if (Session.COMPLETION_MODE_FIRST.equalsIgnoreCase(completion)) {
if (!subShell.isEmpty()) {
List<Completer> completers = new ArrayList<Completer>();
for (String name : allCompleters[1].keySet()) {
if (name.startsWith(subShell + ":")) {
completers.add(allCompleters[1].get(name));
}
}
int res = new AggregateCompleter(completers).complete(session, commandLine, candidates);
if (!candidates.isEmpty()) {
Collections.sort(candidates);
return res;
}
}
List<Completer> compl = new ArrayList<Completer>();
compl.add(aliasesCompleter);
compl.addAll(allCompleters[0].values());
int res = new AggregateCompleter(compl).complete(session, commandLine, candidates);
Collections.sort(candidates);
return res;
}
List<Completer> compl = new ArrayList<Completer>();
compl.add(aliasesCompleter);
compl.addAll(allCompleters[0].values());
int res = new AggregateCompleter(compl).complete(session, commandLine, candidates);
Collections.sort(candidates);
return res;
}