3import System.Console.Haskeline
5import System.Environment
10import Control.Monad.State
13import Core.ShellParser
18import Core.Constraints
24import Idris.Primitives
32-- Main program reads command line options, parses the main program, and gets
35main = do xs <- getArgs
36 let opts = parseArgs xs
37 runInputT defaultSettings $ execStateT (runIdris opts) idrisInit
39runIdris :: [Opt] -> Idris ()
41 when (Ver `elem` opts) $ liftIO showver
42 when (Usage `elem` opts) $ liftIO usage
43 when (ShowIncs `elem` opts) $ liftIO showIncs
44 when (ShowLibs `elem` opts) $ liftIO showLibs
45 when (ShowLibdir `elem` opts) $ liftIO showLibdir
46 case opt getPkgClean opts of
48 fs -> do liftIO $ mapM_ cleanPkg fs
49 liftIO $ exitWith ExitSuccess
50 case opt getPkg opts of
51 [] -> idrisMain opts -- in Idris.REPL
52 fs -> liftIO $ mapM_ (buildPkg (WarnOnly `elem` opts)) fs
54usage = do putStrLn usagemsg
57showver = do putStrLn $ "Idris version " ++ ver
60showLibs = do dir <- getDataDir
61 putStrLn $ "-L" ++ dir ++ "/rts -lidris_rts -lgmp -lpthread"
64showLibdir = do dir <- getDataDir
68showIncs = do dir <- getDataDir
69 putStrLn $ "-I" ++ dir ++ "/rts"
72usagemsg = "Idris version " ++ ver ++ "\n" ++
73 "--------------" ++ map (\x -> '-') ver ++ "\n" ++
74 "Usage: idris [input file] [options]\n" ++
76 "\t--check Type check only\n" ++
77 "\t-o [file] Generate executable\n" ++
78 "\t-i [dir] Add directory to the list of import paths\n" ++
79 "\t--ibcsubdir [dir] Write IBC files into sub directory\n" ++
80 "\t--noprelude Don't import the prelude\n" ++
81 "\t--typeintype Disable universe checking\n" ++
82 "\t--log [level] Set debugging log level\n" ++
83 "\t--libdir Show library install directory and exit\n" ++
84 "\t--link Show C library directories and exit (for C linking)\n" ++
85 "\t--include Show C include directories and exit (for C linking)\n"
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