2 Commits
0.6.2 ... 0.6.4

2 changed files with 4 additions and 4 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]
@ -199,8 +199,8 @@ proc queryParamsToCliArgs*(queryParams: Table[string, string]): seq[string] =
if k.startsWith("arg"): result.add(v)
else :
result[1].add("--" & k)
if v != "true": result[1].add(v) # support things like ?verbose=true -> cmd --verbose
result.add("--" & k)
if v != "true": result.add(v) # support things like ?verbose=true -> cmd --verbose
proc queryParamsToCliArgs*(queryParams: StringTableRef): seq[string] =
result = @[]

View File

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