blob: 9f84fd2dd19a6824dd7f38af799c24a664cf3e28 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
module Main where
import Fig.Prelude
import Options.Applicative
import qualified Fig.Bus
data Opts = Opts
{ host :: Text
, port :: Text
}
parseOpts :: Parser Opts
parseOpts = Opts
<$> strOption (long "host" <> metavar "HOST" <> help "Interface to bind" <> value "localhost")
<*> strOption (long "port" <> metavar "PORT" <> help "Port to bind" <> showDefault <> value "32050")
main :: IO ()
main = do
opts <- execParser $ info (parseOpts <**> helper)
( fullDesc
<> header "fig-bus - a pub/sub message bus"
)
Fig.Bus.main (Just opts.host, opts.port)
|