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-monitor-irc/main/Main.hs | |
Initial commit
Diffstat (limited to 'fig-monitor-irc/main/Main.hs')
| -rw-r--r-- | fig-monitor-irc/main/Main.hs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/fig-monitor-irc/main/Main.hs b/fig-monitor-irc/main/Main.hs new file mode 100644 index 0000000..c28061b --- /dev/null +++ b/fig-monitor-irc/main/Main.hs @@ -0,0 +1,29 @@ +module Main where + +import Fig.Prelude + +import Options.Applicative + +import Fig.Monitor.IRC +import Fig.Monitor.IRC.Utils + +data Opts = Opts + { busHost :: Text + , busPort :: Text + , config :: FilePath + } + +parseOpts :: Parser Opts +parseOpts = Opts + <$> strOption (long "bus-host" <> metavar "HOST" <> help "Address of message bus" <> value "localhost") + <*> strOption (long "bus-port" <> metavar "PORT" <> help "Message bus port" <> showDefault <> value "32050") + <*> strOption (long "config" <> metavar "PATH" <> help "Path to config file" <> showDefault <> value "fig-monitor-irc.toml") + +main :: IO () +main = do + opts <- execParser $ info (parseOpts <**> helper) + ( fullDesc + <> header "fig-monitor-discord - monitor IRC chat events" + ) + cfg <- loadConfig opts.config + ircBot cfg (opts.busHost, opts.busPort) |
