From dcef0b65069fb38fd0f6c4382353167f603ebff1 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Thu, 16 Nov 2023 19:06:43 -0500 Subject: Initial commit --- fig-bus/main/Main.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 fig-bus/main/Main.hs (limited to 'fig-bus/main') diff --git a/fig-bus/main/Main.hs b/fig-bus/main/Main.hs new file mode 100644 index 0000000..9f84fd2 --- /dev/null +++ b/fig-bus/main/Main.hs @@ -0,0 +1,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) -- cgit v1.2.3