diff options
author | Teddy Wing | 2017-08-20 18:17:54 +0200 |
---|---|---|
committer | Teddy Wing | 2017-08-20 18:17:54 +0200 |
commit | 5792fb1fc1439994a4877761820d8d034b66110d (patch) | |
tree | 37209d27856028dc320acf85103bc601ce1d281a /src | |
parent | b8d535020feeea4233306c2063f19c25f383384f (diff) | |
download | sorbot-5792fb1fc1439994a4877761820d8d034b66110d.tar.bz2 |
CliOptions(parseOptions): Return options
Make the parsed options accessible to the rest of the program.
Diffstat (limited to 'src')
-rw-r--r-- | src/CliOptions.hs | 7 | ||||
-rw-r--r-- | src/Lib.hs | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/CliOptions.hs b/src/CliOptions.hs index b848e2b..60f05ad 100644 --- a/src/CliOptions.hs +++ b/src/CliOptions.hs @@ -1,5 +1,7 @@ module CliOptions - ( parseOptions + ( Options(..) + + , parseOptions ) where import Data.Semigroup ((<>)) @@ -24,10 +26,9 @@ options = Options <> value "en" <> help "Set the language Sorbot will speak in (en | fr)" ) -parseOptions :: IO () +parseOptions :: IO Options parseOptions = do execParser opts - return () where opts = info (options <**> helper) ( fullDesc @@ -6,12 +6,12 @@ module Lib import Database.SQLite.Simple -import CliOptions (parseOptions) +import CliOptions (Options(language), parseOptions) import IRC (connectIRC) import Message import Plugin someFunc :: IO () someFunc = do - parseOptions + options <- parseOptions connectIRC "irc.freenode.net" 6697 "test-bot-7890asdf" |