10import Util.System (setupBundledCC)
12import Control.Monad (when)
13import System.Exit (exitSuccess)
15processShowOptions :: [Opt] -> Idris ()
16processShowOptions opts = runIO $ do
17 when (ShowAll `elem` opts) $ showExitIdrisInfo
18 when (ShowLoggingCats `elem` opts) $ showExitIdrisLoggingCategories
19 when (ShowIncs `elem` opts) $ showExitIdrisFlagsInc
20 when (ShowLibs `elem` opts) $ showExitIdrisFlagsLibs
21 when (ShowLibDir `elem` opts) $ showExitIdrisLibDir
22 when (ShowDocDir `elem` opts) $ showExitIdrisDocDir
23 when (ShowPkgs `elem` opts) $ showExitIdrisInstalledPackages
25check :: [Opt] -> (Opt -> Maybe a) -> ([a] -> Idris ()) -> Idris ()
26check opts extractOpts action = do
27 case opt extractOpts opts of
32processClientOptions :: [Opt] -> Idris ()
33processClientOptions opts = check opts getClient $ \fs -> case fs of
34 [] -> ifail "No --client argument. This indicates a bug. Please report."
39 Just DontListen -> ifail "\"--client\" and \"--port none\" are incompatible"
40 Just (ListenPort port) -> runIO $ runClient (Just port) c
41 Nothing -> runIO $ runClient Nothing c
43processPackageOptions :: [Opt] -> Idris ()
44processPackageOptions opts = do
45 check opts getPkgCheck $ \fs -> runIO $ do
46 mapM_ (checkPkg opts (WarnOnly `elem` opts) True) fs
47 check opts getPkgClean $ \fs -> runIO $ do
48 mapM_ (cleanPkg opts) fs
49 check opts getPkgMkDoc $ \fs -> runIO $ do
50 mapM_ (documentPkg opts) fs
51 check opts getPkgTest $ \fs -> runIO $ do
52 mapM_ (testPkg opts) fs
53 check opts getPkg $ \fs -> runIO $ do
54 mapM_ (buildPkg opts (WarnOnly `elem` opts)) fs
55 check opts getPkgREPL $ \fs -> case fs of
57 _ -> ifail "Too many packages"
59-- | The main function for the Idris executable.
60runIdris :: [Opt] -> Idris ()
63 processShowOptions opts -- Show information then quit.
64 processClientOptions opts -- Be a client to a REPL server.
65 processPackageOptions opts -- Work with Idris packages.
66 idrisMain opts -- Launch REPL or compile mode.
68-- Main program reads command line options, parses the main program, and gets
73 runMain (runIdris opts)
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