3import System.Console.Haskeline
5import System.Environment
7import System.FilePath ((</>), addTrailingPathSeparator)
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
38-- Main program reads command line options, parses the main program, and gets
42main = do opts <- runArgParser
43 runMain (runIdris opts)
45runIdris :: [Opt] -> Idris ()
48 when (ShowLoggingCats `elem` opts) $ runIO showLoggingCats
49 when (ShowIncs `elem` opts) $ runIO showIncs
50 when (ShowLibs `elem` opts) $ runIO showLibs
51 when (ShowLibdir `elem` opts) $ runIO showLibdir
52 when (ShowPkgs `elem` opts) $ runIO showPkgs
53 case opt getClient opts of
55 (c:_) -> do setVerbose False
57 runIO $ runClient (getPort opts) c
58 runIO $ exitWith ExitSuccess
59 case opt getPkgCheck opts of
61 fs -> do runIO $ mapM_ (checkPkg (WarnOnly `elem` opts) True) fs
62 runIO $ exitWith ExitSuccess
63 case opt getPkgClean opts of
65 fs -> do runIO $ mapM_ cleanPkg fs
66 runIO $ exitWith ExitSuccess
67 case opt getPkgMkDoc opts of -- IdrisDoc
69 fs -> do runIO $ mapM_ documentPkg fs
70 runIO $ exitWith ExitSuccess
71 case opt getPkgTest opts of
73 fs -> do runIO $ mapM_ testPkg fs
74 runIO $ exitWith ExitSuccess
75 case opt getPkg opts of
76 [] -> case opt getPkgREPL opts of
79 _ -> ifail "Too many packages"
80 fs -> runIO $ mapM_ (buildPkg (WarnOnly `elem` opts)) fs
83showver = do putStrLn $ "Idris version " ++ ver
87showLibs = do libFlags <- getLibFlags
88 putStrLn $ unwords libFlags
92showLibdir = do dir <- getIdrisLibDir
97showIncs = do incFlags <- getIncFlags
98 putStrLn $ unwords incFlags
101-- | List idris packages installed
103showPkgs = do mapM putStrLn =<< installedPackages
106showLoggingCats :: IO b
108 putStrLn loggingCatsStr
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