myriad/app/Main.hs
2019-09-05 10:17:20 -04:00

38 lines
989 B
Haskell

module Main where
import qualified Data.Text as T
import Options.Applicative
import Myriad
data Args = Args
{ configInput :: T.Text
, languagesDir :: T.Text
}
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"
, value "./config.dhall"
, showDefault
])
<*> option str (mconcat
[ long "languages"
, short 'l'
, help "Set the languages directory"
, metavar "DIR"
, value "./languages/"
, showDefault
])
main :: IO ()
main = do
Args { configInput, languagesDir } <- parseArgs
runMyriadServer configInput languagesDir