Age | Commit message (Collapse) | Author |
|
Move the CLI option extracting to a new function that moves the option
parsing logic outside the plugin.
|
|
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`.
|
|
Make the parsed options accessible to the rest of the program.
|
|
Provide a way to switch languages when starting the bot.
|
|
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.
|