Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions terminal/src/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ data Flags =

run :: () -> Flags -> IO ()
run () flags =
do printWelcomeMessage
do printWelcomeMessage flags
settings <- initSettings
env <- initEnv flags
let looper = Repl.runInputT settings (Repl.withInterrupt (loop env initialState))
Expand All @@ -94,20 +94,28 @@ run () flags =
-- WELCOME


printWelcomeMessage :: IO ()
printWelcomeMessage =
printWelcomeMessage :: Flags -> IO ()
printWelcomeMessage (Flags _ noColors) =
let
vsn = V.toChars V.compiler
title = "Elm" <+> D.fromChars vsn
dashes = replicate (70 - length vsn) '-'
help = "Say :help for help and :exit to exit! More at " <> D.makeLink "repl"
in
D.toAnsi IO.stdout $
D.vcat
[ D.black "----" <+> D.dullcyan title <+> D.black (D.fromChars dashes)
, D.black $ D.fromChars $ "Say :help for help and :exit to exit! More at " <> D.makeLink "repl"
, D.black "--------------------------------------------------------------------------------"
, D.empty
]
D.vcat $
if noColors then
[ "----" <+> title <+> D.fromChars dashes
, D.fromChars help
, "--------------------------------------------------------------------------------"
, D.empty
]
else
[ D.black "----" <+> D.dullcyan title <+> D.black (D.fromChars dashes)
, D.black (D.fromChars help)
, D.black "--------------------------------------------------------------------------------"
, D.empty
]



Expand Down