diff options
author | Julien Dessaux | 2011-04-13 20:15:55 +0200 |
---|---|---|
committer | Julien Dessaux | 2011-04-13 20:15:55 +0200 |
commit | ff07633fb8f81577ffec409cbf0a3c7361990f6c (patch) | |
tree | 5021a2e13f878c6b29ad3ec835f694d0726b7e9c /HsbotIrcBot/Main.hs | |
parent | Regressed from parsec3 to parsec2 to solve a cabal install weird dependency p... (diff) | |
download | hsbot-ff07633fb8f81577ffec409cbf0a3c7361990f6c.tar.gz hsbot-ff07633fb8f81577ffec409cbf0a3c7361990f6c.tar.bz2 hsbot-ff07633fb8f81577ffec409cbf0a3c7361990f6c.zip |
Began a big refactoring/rewriting (again)
Diffstat (limited to 'HsbotIrcBot/Main.hs')
-rw-r--r-- | HsbotIrcBot/Main.hs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/HsbotIrcBot/Main.hs b/HsbotIrcBot/Main.hs deleted file mode 100644 index 97e7052..0000000 --- a/HsbotIrcBot/Main.hs +++ /dev/null @@ -1,34 +0,0 @@ -module Main (main) where - -import Control.Monad (when) -import System.Console.GetOpt -import System.Environment -import System.Exit -import System.IO - -import Hsbot.Irc.CLI -import Hsbot.Irc.Config -import Hsbot.Irc.Core - --- | Main function -main :: IO () -main = do - args <- getArgs - -- Parse options, getting a list of option actions - let (actions, nonOptions, errors) = getOpt RequireOrder options args - -- Here we thread startOptions through all supplied option actions - opts <- case (nonOptions, errors) of - ([], []) -> foldl (>>=) (return defaultOptions) actions - (_, _) -> do - hPutStrLn stderr $ concat errors ++ usageInfo header options - exitWith $ ExitFailure 1 - -- From there the initialization code truly begins - when (optDebug opts) . putStrLn $ "[hsbot-irc] Got CLI options :\n" ++ (show opts) - -- We find and parse the config file - ircConfig <- getIrcConfig $ optConfigFile opts - when (optDebug opts) . putStrLn $ "[hsbot-irc] Compiled config :\n" ++ (show ircConfig) - -- Finally we get into the ircbot stuff - case optDebug opts of - True -> startIrcbot opts ircConfig - False -> startIrcbot opts ircConfig -- TODO : fork process in background - |