aboutsummaryrefslogtreecommitdiffstats
path: root/src/CliOptions.hs
AgeCommit message (Collapse)Author
2017-08-20GitHubCommit: Extract language handling to a functionTeddy Wing
Move the CLI option extracting to a new function that moves the option parsing logic outside the plugin.
2017-08-20CliOptions: Parse the `language` option into a `Locale`Teddy Wing
Instead of parsing `--language` as a string, parse it as a real `Locale` type. This means the parsing is taken care of for us at the CLI option handling stage instead of later on. We can thus use the language value more quickly and easily, passing it to the `translate` function, which takes a `Locale`.
2017-08-20CliOptions(parseOptions): Return optionsTeddy Wing
Make the parsed options accessible to the rest of the program.
2017-08-20CliOptions: Add command line option for languageTeddy Wing
Provide a way to switch languages when starting the bot.
2017-08-19Add command line option handlingTeddy Wing
Use 'optparse-applicative' to parse command line options. Provide a `--slack-token` option that sets a Slack API token to enable access to the chat platform. More options will come as needed (including things like database name, language, possibly IRC configuration). Code is based on the example in https://hackage.haskell.org/package/optparse-applicative Pretty cool option parser.