diff options
author | tv <tv@krebsco.de> | 2017-05-23 20:02:26 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2017-05-23 20:02:26 +0200 |
commit | 9a698e0c32bc413bce575bfd9aaeaa5364afc403 (patch) | |
tree | c42671245a8650c2fb51bf7caa0e2fff40abcefc /Config.hs | |
parent | c78f3c62c0ba76465e39d1570073f867aa2d4240 (diff) |
Config -> Kirk.Config
Diffstat (limited to 'Config.hs')
-rw-r--r-- | Config.hs | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/Config.hs b/Config.hs deleted file mode 100644 index fc959e1..0000000 --- a/Config.hs +++ /dev/null @@ -1,61 +0,0 @@ -{-# LANGUAGE ApplicativeDo #-} -{-# LANGUAGE RecordWildCards #-} - -module Config - ( Config(..) - , parseConfigFromArgs - ) - where - -import Data.Monoid -import Network.Socket (HostName,PortNumber) -import Options.Applicative - - -data Config = Config - { nick :: String - , msgtarget :: [String] - , server_hostname :: HostName - , server_port :: PortNumber - } - - -config :: Parser Config -config = do - nick <- strOption - ( long "nick" - <> value "ircout" - <> metavar "NICK" ) - - server_hostname <- strOption - ( long "host" - <> value "ni.r" - <> metavar "HOST" ) - - server_port <- option auto - ( long "port" - <> value 6667 - <> metavar "PORT") - - msgtarget <- some (argument str - ( metavar "TARGET..." - <> help - "List of channels and nicks. \ - \Ircout will join all channels. \ - \Users get messaged directly" - )) - - pure Config{..} - - -pinfo :: ParserInfo Config -pinfo = - info (config <**> helper) - ( fullDesc - <> progDesc "Read lines from stdin and forward them to IRC." - <> header "ircout - forward stdin to IRC" - ) - - -parseConfigFromArgs :: IO Config -parseConfigFromArgs = execParser pinfo |