Skip to content

Commit 9392720

Browse files
committed
Handle EndOfFileException
1 parent c0f3361 commit 9392720

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/MultimodeCommand.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import org.jline.builtins.Completers;
5757
import org.jline.reader.Candidate;
5858
import org.jline.reader.Completer;
59+
import org.jline.reader.EndOfFileException;
5960
import org.jline.reader.LineReader;
6061
import org.jline.reader.LineReaderBuilder;
6162
import org.jline.reader.ParsedLine;
@@ -312,7 +313,7 @@ private static Completer getValueCompleter(ParamModel option) {
312313
}
313314
return (LineReader line, ParsedLine parsedLine, List<Candidate> candidates) -> {
314315
// For cases where we don't know which values would be valid, only return the
315-
// FileNameCompleter when the user use a file-like value
316+
// FileNameCompleter when the user tries to autocomplete a file-like value
316317
if (Stream.of(".", "..", "../", "~", "/", "..\\", "./")
317318
.anyMatch(parsedLine.word()::startsWith)) {
318319
new Completers.FileNameCompleter().complete(line, parsedLine, candidates);
@@ -404,7 +405,7 @@ public String prompt(String message) throws IOException {
404405
return reader.readLine(message);
405406
}
406407
return reader.readLine();
407-
} catch (UserInterruptException ignored) {
408+
} catch (UserInterruptException | EndOfFileException ignored) {
408409
return null;
409410
}
410411
}

0 commit comments

Comments
 (0)