Skip to content

Commit

Permalink
nim secret: support linenoise when available (#13328)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour authored Feb 5, 2020
1 parent c6d5f0d commit 574f613
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/llstream.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import
pathutils

# support '-d:useGnuReadline' for backwards compatibility:
when not defined(windows) and (defined(useGnuReadline) or defined(useLinenoise)):
import rdstdin
template imp(x) = import x
const hasRstdin = compiles(imp(rdstdin))
when hasRstdin: import rdstdin

type
TLLRepl* = proc (s: PLLStream, buf: pointer, bufLen: int): int
Expand Down Expand Up @@ -67,7 +67,7 @@ proc llStreamClose*(s: PLLStream) =
of llsFile:
close(s.f)

when not declared(readLineFromStdin):
when not hasRstdin:
# fallback implementation:
proc readLineFromStdin(prompt: string, line: var string): bool =
stderr.write(prompt)
Expand Down

0 comments on commit 574f613

Please sign in to comment.