myriad/app/Main.hs

36 lines
955 B
Haskell
Raw Normal View History

2019-07-09 05:19:41 -04:00
module Main where
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
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
])
<*> 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-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