myriad/app/Main.hs

36 lines
955 B
Haskell
Raw Permalink Normal View History

2019-07-09 11:19:41 +02:00
module Main where
import Options.Applicative
import Myriad
2019-07-09 11:19:41 +02:00
2019-07-11 07:00:41 +02:00
data Args = Args
2020-06-17 04:02:12 +02:00
{ configPath :: FilePath
, languagesDir :: FilePath
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'
2020-06-17 04:02:12 +02:00
, help "Set the myriad configuration"
, metavar "PATH"
, value "./config.yaml"
2019-09-05 16:17:20 +02:00
, 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
2020-06-17 04:02:12 +02:00
Args { configPath, languagesDir } <- parseArgs
runMyriadServer configPath languagesDir