mirror of
https://github.com/CrystalSplitter/ghcitui.git
synced 2024-09-11 10:55:29 +03:00
Clean up Main.hs
This commit is contained in:
parent
88992b7742
commit
cf4b21272c
36
app/Main.hs
36
app/Main.hs
@ -6,40 +6,6 @@ import qualified Options.Applicative as Opt
|
||||
import qualified AppConfig
|
||||
import BrickUI (launchBrick)
|
||||
|
||||
{-
|
||||
Old code for reference.
|
||||
|
||||
launch :: IO ()
|
||||
launch = do
|
||||
state <- D.startup "cabal repl" "."
|
||||
(state, _) <- D.exec state ":l app/Main.hs"
|
||||
fileRef <- loadFileSrc "app/Main.hs"
|
||||
let surroundingSrc windowSize D.InterpState{D.lineno} =
|
||||
do
|
||||
src <- readIORef fileRef
|
||||
case lineno of
|
||||
Nothing -> pure []
|
||||
Just l -> pure $ getSurroundingSrc src windowSize l
|
||||
state <- D.stepInto state "fibty 10"
|
||||
let loop s = do
|
||||
print s
|
||||
newWindow <- surroundingSrc 5 s
|
||||
newS <- D.step state
|
||||
mapM_ TextIO.putStrLn newWindow
|
||||
putStr "%% "
|
||||
SIO.hFlush SIO.stdout
|
||||
stdinLine <- getLine
|
||||
if stdinLine == "q"
|
||||
then pure ()
|
||||
else do
|
||||
(newS, msgs) <- D.exec state stdinLine
|
||||
mapM_ (putStrLn . ("OUT: " ++)) msgs
|
||||
loop newS
|
||||
loop state
|
||||
D.quit state
|
||||
pure ()
|
||||
-}
|
||||
|
||||
-- | Holds passed in command line options.
|
||||
data CmdOptions = CmdOptions
|
||||
{ debugConsole :: !Bool
|
||||
@ -91,5 +57,5 @@ main = do
|
||||
where
|
||||
parserInfo =
|
||||
Opt.info
|
||||
(Opt.helper Opt.<*> parseOpts)
|
||||
(Opt.helper <*> parseOpts)
|
||||
(Opt.fullDesc <> Opt.progDesc "Program Description")
|
||||
|
Loading…
Reference in New Issue
Block a user