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
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 when (ShowPkgs `elem` opts) $ runIO showPkgs
50 case opt getClient opts of
52 (c:_) -> do setVerbose False
54 runIO $ runClient (getPort opts) c
55 runIO $ exitWith ExitSuccess
56 case opt getPkgCheck opts of
58 fs -> do runIO $ mapM_ (checkPkg (WarnOnly `elem` opts) True) fs
59 runIO $ exitWith ExitSuccess
60 case opt getPkgClean opts of
62 fs -> do runIO $ mapM_ cleanPkg fs
63 runIO $ exitWith ExitSuccess
64 case opt getPkgMkDoc opts of -- IdrisDoc
66 fs -> do runIO $ mapM_ documentPkg fs
67 runIO $ exitWith ExitSuccess
68 case opt getPkgTest opts of
70 fs -> do runIO $ mapM_ testPkg fs
71 runIO $ exitWith ExitSuccess
72 case opt getPkg opts of
73 [] -> case opt getPkgREPL opts of
76 _ -> ifail "Too many packages"
77 fs -> runIO $ mapM_ (buildPkg (WarnOnly `elem` opts)) fs
80showver = do putStrLn $ "Idris version " ++ ver
84showLibs = do libFlags <- getLibFlags
85 putStrLn $ unwords libFlags
89showLibdir = do dir <- getIdrisLibDir
94showIncs = do incFlags <- getIncFlags
95 putStrLn $ unwords incFlags
98-- | List idris packages installed
100showPkgs = do mapM putStrLn =<< installedPackages
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