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 (ShowIncs `elem` opts) $ runIO showIncs
49 when (ShowLibs `elem` opts) $ runIO showLibs
50 when (ShowLibdir `elem` opts) $ runIO showLibdir
51 when (ShowPkgs `elem` opts) $ runIO showPkgs
52 case opt getClient opts of
54 (c:_) -> do setVerbose False
56 runIO $ runClient (getPort opts) c
57 runIO $ exitWith ExitSuccess
58 case opt getPkgCheck opts of
60 fs -> do runIO $ mapM_ (checkPkg (WarnOnly `elem` opts) True) fs
61 runIO $ exitWith ExitSuccess
62 case opt getPkgClean opts of
64 fs -> do runIO $ mapM_ cleanPkg fs
65 runIO $ exitWith ExitSuccess
66 case opt getPkgMkDoc opts of -- IdrisDoc
68 fs -> do runIO $ mapM_ documentPkg fs
69 runIO $ exitWith ExitSuccess
70 case opt getPkgTest opts of
72 fs -> do runIO $ mapM_ testPkg fs
73 runIO $ exitWith ExitSuccess
74 case opt getPkg opts of
75 [] -> case opt getPkgREPL opts of
78 _ -> ifail "Too many packages"
79 fs -> runIO $ mapM_ (buildPkg (WarnOnly `elem` opts)) fs
82showver = do putStrLn $ "Idris version " ++ ver
86showLibs = do libFlags <- getLibFlags
87 putStrLn $ unwords libFlags
91showLibdir = do dir <- getIdrisLibDir
96showIncs = do incFlags <- getIncFlags
97 putStrLn $ unwords incFlags
100-- | List idris packages installed
102showPkgs = 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