Search in sources :

Example 1 with FilesCompleter

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

the class Builtin method __files.

public List<Candidate> __files(CommandSession session) {
    ParsedLine line = Shell.getParsedLine(session);
    LineReader reader = Shell.getReader(session);
    List<Candidate> candidates = new ArrayList<>();
    new FilesCompleter(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) ParsedLine(org.jline.reader.ParsedLine) LineReader(org.jline.reader.LineReader) ArrayList(java.util.ArrayList) FilesCompleter(org.jline.builtins.Completers.FilesCompleter) Terminal(org.jline.terminal.Terminal)

Aggregations

Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 FilesCompleter (org.jline.builtins.Completers.FilesCompleter)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