myriad/app/Main.hs

35 lines
849 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"
])
<*> option str (mconcat
[ long "languages"
, short 'l'
, help "Set the languages directory"
, metavar "DIR"
])
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