3import System.Console.Readline
5import System.Environment
9import Control.Monad.State
12import Core.ShellParser
22import Idris.Primitives
25-- Main program reads command line options, parses the main program, and gets
28data Opt = Filename String
33main = do xs <- getArgs
35 execStateT (runIdris opts) idrisInit
37runIdris :: [Opt] -> Idris ()
39 do let inputs = opt getFile opts
42 mapM_ loadModule inputs
45 makeOption (OLogging i) = setLogLevel i
46 makeOption _ = return ()
48getFile :: Opt -> Maybe String
49getFile (Filename str) = Just str
52opt :: (Opt -> Maybe a) -> [Opt] -> [a]
55usage = do putStrLn "You're doing it wrong"
56 exitWith (ExitFailure 1)
58parseArgs :: [String] -> IO [Opt]
59parseArgs [] = return []
60parseArgs ("--log":lvl:ns) = liftM (OLogging (read lvl) : ) (parseArgs ns)
61parseArgs (n:ns) = liftM (Filename n : ) (parseArgs ns)
65 = do f <- readFile "test.mi"
70 case checkProgram emptyContext defs of
71 OK ctxt -> do print (toAlist ctxt)
72 runShell (initState ctxt)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list