3import System.Console.Haskeline
5import System.Environment
7import System.FilePath ((</>), addTrailingPathSeparator)
11import Control.Monad.Trans.Error ( ErrorT(..) )
12import Control.Monad.Trans.State.Strict ( execStateT, get, put )
13import Control.Monad ( when )
16import Idris.Core.Typecheck
17import Idris.Core.Evaluate
18import Idris.Core.Constraints
24import Idris.Primitives
27import Idris.CmdOptions
29import IRTS.System ( getLibFlags, getIdrisLibDir, getIncFlags )
31import Util.DynamicLinker
37-- Main program reads command line options, parses the main program, and gets
40main = do opts <- runArgParser
41 result <- runErrorT $ execStateT (runIdris opts) idrisInit
43 Left err -> putStrLn $ "Uncaught error: " ++ show err
46runIdris :: [Opt] -> Idris ()
47runIdris [Client c] = do setVerbose False
51 when (ShowIncs `elem` opts) $ runIO showIncs
52 when (ShowLibs `elem` opts) $ runIO showLibs
53 when (ShowLibdir `elem` opts) $ runIO showLibdir
54 case opt getPkgCheck opts of
56 fs -> do runIO $ mapM_ (checkPkg (WarnOnly `elem` opts) True) fs
57 runIO $ exitWith ExitSuccess
58 case opt getPkgClean opts of
60 fs -> do runIO $ mapM_ cleanPkg fs
61 runIO $ exitWith ExitSuccess
62 case opt getPkgMkDoc opts of -- IdrisDoc
64 fs -> do runIO $ mapM_ documentPkg fs
65 runIO $ exitWith ExitSuccess
66 case opt getPkgTest opts of
68 fs -> do runIO $ mapM_ testPkg fs
69 runIO $ exitWith ExitSuccess
70 case opt getPkg opts of
71 [] -> case opt getPkgREPL opts of
74 _ -> ifail "Too many packages"
75 fs -> runIO $ mapM_ (buildPkg (WarnOnly `elem` opts)) fs
77showver = do putStrLn $ "Idris version " ++ ver
80showLibs = do libFlags <- getLibFlags
84showLibdir = do dir <- getIdrisLibDir
88showIncs = do incFlags <- getIncFlags
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