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
41main = do opts <- runArgParser
42 runMain (runIdris opts)
44runIdris :: [Opt] -> Idris ()
46 when (ShowIncs `elem` opts) $ runIO showIncs
47 when (ShowLibs `elem` opts) $ runIO showLibs
48 when (ShowLibdir `elem` opts) $ runIO showLibdir
49 case opt getClient opts of
51 (c:_) -> do setVerbose False
53 runIO $ runClient (getPort opts) c
54 runIO $ exitWith ExitSuccess
55 case opt getPkgCheck opts of
57 fs -> do runIO $ mapM_ (checkPkg (WarnOnly `elem` opts) True) fs
58 runIO $ exitWith ExitSuccess
59 case opt getPkgClean opts of
61 fs -> do runIO $ mapM_ cleanPkg fs
62 runIO $ exitWith ExitSuccess
63 case opt getPkgMkDoc opts of -- IdrisDoc
65 fs -> do runIO $ mapM_ documentPkg fs
66 runIO $ exitWith ExitSuccess
67 case opt getPkgTest opts of
69 fs -> do runIO $ mapM_ testPkg fs
70 runIO $ exitWith ExitSuccess
71 case opt getPkg opts of
72 [] -> case opt getPkgREPL opts of
75 _ -> ifail "Too many packages"
76 fs -> runIO $ mapM_ (buildPkg (WarnOnly `elem` opts)) fs
79showver = do putStrLn $ "Idris version " ++ ver
83showLibs = do libFlags <- getLibFlags
88showLibdir = do dir <- getIdrisLibDir
93showIncs = 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