diff options
| author | LLLL Colonq <llll@colonq> | 2023-11-16 19:06:43 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2023-11-16 19:06:43 -0500 |
| commit | dcef0b65069fb38fd0f6c4382353167f603ebff1 (patch) | |
| tree | 45954ffe308c3dd056e6af4f734e6d2af89e5856 /fig-bus/main | |
Initial commit
Diffstat (limited to 'fig-bus/main')
| -rw-r--r-- | fig-bus/main/Main.hs | 25 |
1 files changed, 25 insertions, 0 deletions
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) |
