From ff07633fb8f81577ffec409cbf0a3c7361990f6c Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 13 Apr 2011 20:15:55 +0200 Subject: Began a big refactoring/rewriting (again) --- HsbotIrcBot/Hsbot/Irc/CLI.hs | 63 -------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 HsbotIrcBot/Hsbot/Irc/CLI.hs (limited to 'HsbotIrcBot/Hsbot/Irc/CLI.hs') diff --git a/HsbotIrcBot/Hsbot/Irc/CLI.hs b/HsbotIrcBot/Hsbot/Irc/CLI.hs deleted file mode 100644 index 4147bd1..0000000 --- a/HsbotIrcBot/Hsbot/Irc/CLI.hs +++ /dev/null @@ -1,63 +0,0 @@ -module Hsbot.Irc.CLI - ( Options (..) - , defaultOptions - , header - , options - ) where - -import System.Console.GetOpt -import System.Exit - --- CLI argument parting stuff {{{ --- | CLI options -data Options = Options - { optDebug :: Bool - , optConfigFile :: Maybe String - , optGroup :: Maybe String - , optUser :: Maybe String - , optVerbose :: Bool - } deriving (Show) - --- | CLI default options -defaultOptions :: Options -defaultOptions = Options { optDebug = False - , optConfigFile = Nothing - , optGroup = Nothing - , optUser = Nothing - , optVerbose = False } - --- | CLI options logic -options :: [ OptDescr (Options -> IO Options) ] -options = - [ Option "d" ["debug"] - (NoArg (\opt -> return opt { optDebug = True, optVerbose = True })) - "Enter verbose debug mode and prevents Hsbot from forking in background" - , Option "f" ["file"] - (ReqArg (\arg opt -> return opt { optConfigFile = return arg }) "") - "The config file to use" - , Option "g" ["group"] - (ReqArg (\arg opt -> return opt { optGroup = return arg }) "") - "The group hsbot will run as" - , Option "h" ["help"] - (NoArg (\_ -> do - putStrLn $ usageInfo header options - exitWith ExitSuccess)) - "Print this help message" - , Option "u" ["user"] - (ReqArg (\arg opt -> return opt { optUser = return arg }) "") - "The user hsbot will run as" - , Option "v" ["verbose"] - (NoArg (\opt -> return opt { optVerbose = True })) - "Enable verbose messages" - , Option "V" ["version"] - (NoArg (\_ -> do - putStrLn "hsbot-irc version 0.3" - exitWith ExitSuccess)) - "Show version" - ] - --- | Usage header -header :: String -header = "Usage: hsbot-irc [-dhvV] [-f config_file] [-u user] [-g group]" --- }}} - -- cgit v1.2.3