Skip to content

Commit 4425fe2

Browse files
committed
Use built-in readLine function for prompt.
1 parent 6072c7f commit 4425fe2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clikt/src/main/kotlin/com/github/ajalt/clikt/output/CliktConsole.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ class InteractiveCliktConsole(private val console: Console) : CliktConsole {
5656
}
5757

5858
class NonInteractiveCliktConsole : CliktConsole {
59-
private val inReader by lazy { System.`in`.bufferedReader() }
60-
6159
override fun promptForLine(prompt: String, hideInput: Boolean) = try {
6260
print(prompt, false)
63-
inReader.readLine() ?: throw RuntimeException("EOF")
61+
readLine() ?: throw RuntimeException("EOF")
6462
} catch (err: IOException) {
6563
throw err
6664
}

0 commit comments

Comments
 (0)