aboutsummaryrefslogtreecommitdiffstats
path: root/src/CliOptions.hs
blob: b848e2bc68f4ddab947e271b737cb3ff8aa36868 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module CliOptions
    ( parseOptions
    ) where

import Data.Semigroup ((<>))
import Options.Applicative

data Options = Options
    { slackApiToken :: String
    , language      :: String
    }

options :: Parser Options
options = Options
    <$> strOption
         ( long "slack-token"
        <> metavar "TOKEN"
        <> value ""
        <> help "Token to access Slack's real-time messaging API" )
    <*> strOption
         ( long "language"
        <> short 'l'
        <> metavar "en"
        <> value "en"
        <> help "Set the language Sorbot will speak in (en | fr)" )

parseOptions :: IO ()
parseOptions = do
    execParser opts
    return ()
  where
    opts = info (options <**> helper)
         ( fullDesc
        <> progDesc "A chat bot with a plugin interface that does a bunch of \
            \random things." )