Fix bug in CombinedConfig: need to allow for config values not defined in the possible CLI args.

This commit is contained in:
Jonathan Bernard 2019-02-18 16:06:10 -06:00
parent 8036af6bc8
commit e9351fbd9d
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ proc getVal*(cfg: CombinedConfig, key: string): string =
let envKey = key.replace('-', '_').toUpper
let jsonKey = key.replace(re"(-\w)", proc (m: RegexMatch): string = ($m)[1..1].toUpper)
if cfg.docopt[argKey]: return $cfg.docopt[argKey]
if cfg.docopt.contains(argKey) and cfg.docopt[argKey]: return $cfg.docopt[argKey]
elif existsEnv(envKey): return getEnv(envKey)
elif cfg.json.hasKey(jsonKey):
let node = cfg.json[jsonKey]

View File

@ -1,6 +1,6 @@
# Package
version = "0.6.2"
version = "0.6.3"
author = "Jonathan Bernard"
description = "Helper functions for writing command line interfaces."
license = "MIT"