2019-07-09 05:19:41 -04:00
|
|
|
module Main where
|
|
|
|
|
2019-07-23 01:24:02 -04:00
|
|
|
import Options.Applicative
|
|
|
|
import Myriad
|
2019-07-09 05:19:41 -04:00
|
|
|
|
2019-07-11 01:00:41 -04:00
|
|
|
data Args = Args
|
2020-06-16 22:02:12 -04:00
|
|
|
{ configPath :: FilePath
|
|
|
|
, languagesDir :: FilePath
|
2019-07-11 01:00:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
parseArgs :: IO Args
|
|
|
|
parseArgs = execParser $ info (helper <*> args) (fullDesc <> progDesc "Run the Myriad server")
|
|
|
|
where
|
2019-09-05 10:17:08 -04:00
|
|
|
args = Args
|
|
|
|
<$> option str (mconcat
|
|
|
|
[ long "config"
|
|
|
|
, short 'c'
|
2020-06-16 22:02:12 -04:00
|
|
|
, help "Set the myriad configuration"
|
|
|
|
, metavar "PATH"
|
|
|
|
, value "./config.yaml"
|
2019-09-05 10:17:20 -04:00
|
|
|
, showDefault
|
2019-09-05 10:17:08 -04:00
|
|
|
])
|
|
|
|
<*> option str (mconcat
|
|
|
|
[ long "languages"
|
|
|
|
, short 'l'
|
|
|
|
, help "Set the languages directory"
|
|
|
|
, metavar "DIR"
|
2019-09-05 10:17:20 -04:00
|
|
|
, value "./languages/"
|
|
|
|
, showDefault
|
2019-09-05 10:17:08 -04:00
|
|
|
])
|
2019-07-11 01:00:41 -04:00
|
|
|
|
2019-07-09 05:19:41 -04:00
|
|
|
main :: IO ()
|
|
|
|
main = do
|
2020-06-16 22:02:12 -04:00
|
|
|
Args { configPath, languagesDir } <- parseArgs
|
|
|
|
runMyriadServer configPath languagesDir
|