2022-01-18 14:25:42 +03:00
|
|
|
module Main (main) where
|
|
|
|
|
2022-05-18 18:10:10 +03:00
|
|
|
import App
|
2022-09-14 17:16:15 +03:00
|
|
|
import CommonOptions
|
2022-08-03 14:20:40 +03:00
|
|
|
import Juvix.Compiler.Pipeline
|
2022-11-10 14:26:38 +03:00
|
|
|
import Root
|
2022-09-14 17:16:15 +03:00
|
|
|
import TopCommand
|
|
|
|
import TopCommand.Options
|
2022-03-25 02:52:30 +03:00
|
|
|
|
2022-09-14 17:16:15 +03:00
|
|
|
main :: IO ()
|
|
|
|
main = do
|
|
|
|
let p = prefs showHelpOnEmpty
|
|
|
|
(global, cli) <- customExecParser p descr >>= secondM makeAbsPaths
|
2022-11-10 14:26:38 +03:00
|
|
|
(root, pkg) <- findRoot' cli
|
2022-09-14 17:16:15 +03:00
|
|
|
runM (runAppIO global root pkg (runTopCommand cli))
|
2022-04-01 13:32:15 +03:00
|
|
|
where
|
2022-11-10 14:26:38 +03:00
|
|
|
findRoot' :: TopCommand -> IO (FilePath, Package)
|
|
|
|
findRoot' cli = findRoot (topCommandInputFile cli)
|