aboutsummaryrefslogtreecommitdiffstats
path: root/src/CliOptions.hs
diff options
context:
space:
mode:
authorTeddy Wing2017-08-20 20:38:52 +0200
committerTeddy Wing2017-08-20 20:40:56 +0200
commit0b20b2b113e68396a8ab4e6b59b349dc9248d85b (patch)
tree828d6b4e6ee5988f688b62fc426601da2b7352c1 /src/CliOptions.hs
parent37c39d1267e6211233a98081ddea9fef2a6f05df (diff)
downloadsorbot-0b20b2b113e68396a8ab4e6b59b349dc9248d85b.tar.bz2
GitHubCommit: Extract language handling to a function
Move the CLI option extracting to a new function that moves the option parsing logic outside the plugin.
Diffstat (limited to 'src/CliOptions.hs')
-rw-r--r--src/CliOptions.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/CliOptions.hs b/src/CliOptions.hs
index 9d8baf6..f29704a 100644
--- a/src/CliOptions.hs
+++ b/src/CliOptions.hs
@@ -1,6 +1,8 @@
module CliOptions
( Options(..)
+ , lang
+
, parseOptions
) where
@@ -43,3 +45,9 @@ parseOptions = do
( fullDesc
<> progDesc "A chat bot with a plugin interface that does a bunch of \
\random things." )
+
+-- | A convenience function to get the configured locale.
+lang :: IO Locale
+lang = do
+ opts <- parseOptions
+ return $ language opts