-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathMain.hs
More file actions
22 lines (20 loc) · 724 Bytes
/
Copy pathMain.hs
File metadata and controls
22 lines (20 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Main where
import App.Arguments qualified as App
import App.Configuration
import App.Ghcid (ghcid)
import Control.Error
import Options.Applicative
import StaticLS.Logger
import StaticLS.Server qualified as StaticLS
import StaticLS.StaticEnv.Options (defaultStaticEnvOptions)
main :: IO ()
main = do
logger <- StaticLS.Logger.setupLogger
mFileConfig <- getFileConfig logger
let jsonOrDefaultOpts = (fromMaybe defaultStaticEnvOptions mFileConfig)
App.execArgParser jsonOrDefaultOpts >>= \case
Success (App.GHCIDOptions {args}) -> ghcid args
argsRes -> do
staticEnvOpts <- App.handleParseResultWithSuppression jsonOrDefaultOpts argsRes
StaticLS.runServer staticEnvOpts logger
pure ()