ConfigHandler

Enables easy configuration across multiple levels. Tries each of the following approaches in order until one finds the required config option

  1. Attributes of the instance (subclass of ConfigHandler) itself (e.g. gitlab_host)
  2. Then look for a specific env variable for that config setting in all caps, e.g. GITLAB_HOST
  3. If those both fail, then look for a YAML configuration file:
    • First identified with a --config / -c option on the command line
    • Then with a path in the APPNAME_CONFIG environment variable - note all caps
    • Then look in the local working directory for .appname.yml
    • Then look for ~/.appname.yml in the user's home directory

Config files are in YAML, and look something like this:

gitlab:
  host: gitlab.com
local:
  root: $HOME/git

Note that nested labels in the config map to hyphenated command line options.