myriad/app/Main.hs

39 lines
989 B
Haskell
Raw Normal View History

2019-07-09 11:19:41 +02:00
module Main where
2019-07-11 07:00:41 +02:00
import qualified Data.Text as T
import Options.Applicative
2019-07-09 11:19:41 +02:00
import Myriad
2019-07-09 11:19:41 +02:00
2019-07-11 07:00:41 +02:00
data Args = Args
{ configInput :: T.Text
, languagesDir :: T.Text
2019-07-11 07:00:41 +02:00
}
parseArgs :: IO Args
parseArgs = execParser $ info (helper <*> args) (fullDesc <> progDesc "Run the Myriad server")
where
args = Args
<$> option str (mconcat
[ long "config"
, short 'c'
, help "Set the Dhall configuration"
, metavar "DHALL"
2019-09-05 16:17:20 +02:00
, value "./config.dhall"
, showDefault
])
<*> option str (mconcat
[ long "languages"
, short 'l'
, help "Set the languages directory"
, metavar "DIR"
2019-09-05 16:17:20 +02:00
, value "./languages/"
, showDefault
])
2019-07-11 07:00:41 +02:00
2019-07-09 11:19:41 +02:00
main :: IO ()
main = do
Args { configInput, languagesDir } <- parseArgs
runMyriadServer configInput languagesDir