diff --git a/cliutils.nim b/cliutils.nim index ef7f62c..9c96713 100644 --- a/cliutils.nim +++ b/cliutils.nim @@ -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] diff --git a/cliutils.nimble b/cliutils.nimble index 0427e88..9426352 100644 --- a/cliutils.nimble +++ b/cliutils.nimble @@ -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"