Search in sources :

Example 1 with DirectoriesCompleter

use of org.jline.builtins.Completers.DirectoriesCompleter in project felix by apache.

the class Builtin method __directories.

public List<Candidate> __directories(CommandSession session) {
    ParsedLine line = Shell.getParsedLine(session);
    LineReader reader = Shell.getReader(session);
    List<Candidate> candidates = new ArrayList<>();
    new DirectoriesCompleter(session.currentDir()) {

        @Override
        protected String getDisplay(Terminal terminal, Path p) {
            return getFileDisplay(session, p);
        }
    }.complete(reader, line, candidates);
    return candidates;
}
Also used : Candidate(org.jline.reader.Candidate) Path(java.nio.file.Path) DirectoriesCompleter(org.jline.builtins.Completers.DirectoriesCompleter) ParsedLine(org.jline.reader.ParsedLine) LineReader(org.jline.reader.LineReader) ArrayList(java.util.ArrayList) Terminal(org.jline.terminal.Terminal)

Aggregations

Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 DirectoriesCompleter (org.jline.builtins.Completers.DirectoriesCompleter)1 Candidate (org.jline.reader.Candidate)1 LineReader (org.jline.reader.LineReader)1 ParsedLine (org.jline.reader.ParsedLine)1 Terminal (org.jline.terminal.Terminal)1