paulhammond/slackcat — pull request #7 by skattyadz (2014-11-17 17:00:13+00:00)
Title: Allow config through environment variables

*Initial PR was on my master branch, but I have more changes to make...*

We store and manage keys for tools like slackcat through environment variables. It an easy way for us to provision servers while keeping packages public. I figured this would be a useful addition to the project, so I've added support for it.

The first commit adds some methods to the Config struct containing this change. I wanted config options to cascade so that base options can be overridden by env vars (or other config files). The second commit makes handling CLI flags a configuration concern. I've kept it separate in case you would rather it worked a different way.

I've noticed some inconsistencies between username and name, icon and icon_emoji. It'd be good to make these more consistent, but I thought I'd let you make that call (are you bothered about backwards compatibility?)

Cheers
-a